ember-source 2.2.1 → 2.3.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,7 @@
6
6
  * Portions Copyright 2008-2011 Apple Inc. All rights reserved.
7
7
  * @license Licensed under MIT license
8
8
  * See https://raw.github.com/emberjs/ember.js/master/LICENSE
9
- * @version 2.2.1
9
+ * @version 2.3.0-beta.1
10
10
  */
11
11
 
12
12
  var enifed, requireModule, require, requirejs, Ember;
@@ -43,6 +43,15 @@ var mainContext = this;
43
43
  requirejs = require = requireModule = function(name) {
44
44
  return internalRequire(name, null);
45
45
  }
46
+ require['default'] = require;
47
+
48
+ function missingModule(name, referrerName) {
49
+ if (referrerName) {
50
+ throw new Error('Could not find module ' + name + ' required by: ' + referrerName);
51
+ } else {
52
+ throw new Error('Could not find module ' + name);
53
+ }
54
+ }
46
55
 
47
56
  function internalRequire(name, referrerName) {
48
57
  var exports = seen[name];
@@ -54,24 +63,22 @@ var mainContext = this;
54
63
  exports = seen[name] = {};
55
64
 
56
65
  if (!registry[name]) {
57
- if (referrerName) {
58
- throw new Error('Could not find module ' + name + ' required by: ' + referrerName);
59
- } else {
60
- throw new Error('Could not find module ' + name);
61
- }
66
+ missingModule(name, referrerName);
62
67
  }
63
68
 
64
69
  var mod = registry[name];
65
70
  var deps = mod.deps;
66
71
  var callback = mod.callback;
67
- var reified = [];
68
72
  var length = deps.length;
73
+ var reified = new Array(length);;
69
74
 
70
75
  for (var i = 0; i < length; i++) {
71
76
  if (deps[i] === 'exports') {
72
- reified.push(exports);
77
+ reified[i] = exports;
78
+ } else if (deps[i] === 'require') {
79
+ reified[i] = require;
73
80
  } else {
74
- reified.push(internalRequire(deps[i], name));
81
+ reified[i] = internalRequire(deps[i], name);
75
82
  }
76
83
  }
77
84
 
@@ -1632,6 +1639,10 @@ enifed('ember-debug', ['exports', 'ember-metal/core', 'ember-metal/debug', 'embe
1632
1639
  _emberMetalFeatures.FEATURES['features-stripped-test'] = true;
1633
1640
  var featuresWereStripped = true;
1634
1641
 
1642
+ if (_emberMetalFeatures.default('features-stripped-test')) {
1643
+ exports.featuresWereStripped = featuresWereStripped = false;
1644
+ }
1645
+
1635
1646
  delete _emberMetalFeatures.FEATURES['features-stripped-test'];
1636
1647
  _warnIfUsingStrippedFeatureFlags(_emberMetalCore.default.ENV.FEATURES, featuresWereStripped);
1637
1648
 
@@ -2507,7 +2518,7 @@ enifed('ember-metal/chains', ['exports', 'ember-metal/debug', 'ember-metal/prope
2507
2518
  return;
2508
2519
  }
2509
2520
 
2510
- var m = obj.__ember_meta__;
2521
+ var m = _emberMetalMeta.peekMeta(obj);
2511
2522
 
2512
2523
  if (!m || !m.readableChainWatchers()) {
2513
2524
  return;
@@ -2555,7 +2566,7 @@ enifed('ember-metal/chains', ['exports', 'ember-metal/debug', 'ember-metal/prope
2555
2566
  return;
2556
2567
  }
2557
2568
 
2558
- var meta = obj['__ember_meta__'];
2569
+ var meta = _emberMetalMeta.peekMeta(obj);
2559
2570
 
2560
2571
  // check if object meant only to be a prototype
2561
2572
  if (meta && meta.proto === obj) {
@@ -2761,7 +2772,7 @@ enifed('ember-metal/chains', ['exports', 'ember-metal/debug', 'ember-metal/prope
2761
2772
 
2762
2773
  function finishChains(obj) {
2763
2774
  // We only create meta if we really have to
2764
- var m = obj.__ember_meta__;
2775
+ var m = _emberMetalMeta.peekMeta(obj);
2765
2776
  if (m) {
2766
2777
  m = _emberMetalMeta.meta(obj);
2767
2778
 
@@ -3077,7 +3088,7 @@ enifed('ember-metal/computed', ['exports', 'ember-metal/debug', 'ember-metal/pro
3077
3088
  }
3078
3089
 
3079
3090
  // don't create objects just to invalidate
3080
- var meta = obj.__ember_meta__;
3091
+ var meta = _emberMetalMeta.peekMeta(obj);
3081
3092
  if (!meta || meta.source !== obj) {
3082
3093
  return;
3083
3094
  }
@@ -3301,22 +3312,20 @@ enifed('ember-metal/computed', ['exports', 'ember-metal/debug', 'ember-metal/pro
3301
3312
  computed property function. You can use this helper to define properties
3302
3313
  with mixins or via `Ember.defineProperty()`.
3303
3314
 
3304
- If you pass function as argument - it will be used as getter.
3305
- You can pass hash with two functions - instead of single function - as argument to provide both getter and setter.
3306
-
3307
- The `get` function should accept two parameters, `key` and `value`. If `value` is not
3308
- undefined you should set the `value` first. In either case return the
3309
- current value of the property.
3310
-
3311
- A computed property defined in this way might look like this:
3315
+ If you pass a function as an argument, it will be used as a getter. A computed
3316
+ property defined in this way might look like this:
3312
3317
 
3313
3318
  ```js
3314
3319
  let Person = Ember.Object.extend({
3315
- firstName: 'Betty',
3316
- lastName: 'Jones',
3320
+ init() {
3321
+ this._super(...arguments);
3322
+
3323
+ this.firstName = 'Betty';
3324
+ this.lastName = 'Jones';
3325
+ },
3317
3326
 
3318
3327
  fullName: Ember.computed('firstName', 'lastName', function() {
3319
- return this.get('firstName') + ' ' + this.get('lastName');
3328
+ return `${this.get('firstName')} ${this.get('lastName')}`;
3320
3329
  })
3321
3330
  });
3322
3331
 
@@ -3328,14 +3337,45 @@ enifed('ember-metal/computed', ['exports', 'ember-metal/debug', 'ember-metal/pro
3328
3337
  client.get('fullName'); // 'Betty Fuller'
3329
3338
  ```
3330
3339
 
3340
+ You can pass a hash with two functions, `get` and `set`, as an
3341
+ argument to provide both a getter and setter:
3342
+
3343
+ ```js
3344
+ let Person = Ember.Object.extend({
3345
+ init() {
3346
+ this._super(...arguments);
3347
+
3348
+ this.firstName = 'Betty';
3349
+ this.lastName = 'Jones';
3350
+ },
3351
+
3352
+ fullName: Ember.computed({
3353
+ get(key) {
3354
+ return `${this.get('firstName')} ${this.get('lastName')}`;
3355
+ },
3356
+ set(key, value) {
3357
+ let [firstName, lastName] = value.split(/\s+/);
3358
+ this.setProperties({ firstName, lastName });
3359
+ return value;
3360
+ }
3361
+ });
3362
+ })
3363
+
3364
+ let client = Person.create();
3365
+ client.get('firstName'); // 'Betty'
3366
+
3367
+ client.set('fullName', 'Carroll Fuller');
3368
+ client.get('firstName'); // 'Carroll'
3369
+ ```
3370
+
3371
+ The `set` function should accept two parameters, `key` and `value`. The value
3372
+ returned from `set` will be the new value of the property.
3373
+
3331
3374
  _Note: This is the preferred way to define computed properties when writing third-party
3332
3375
  libraries that depend on or use Ember, since there is no guarantee that the user
3333
- will have prototype extensions enabled._
3376
+ will have [prototype Extensions](http://emberjs.com/guides/configuring-ember/disabling-prototype-extensions/) enabled._
3334
3377
 
3335
- You might use this method if you disabled
3336
- [Prototype Extensions](http://emberjs.com/guides/configuring-ember/disabling-prototype-extensions/).
3337
- The alternative syntax might look like this
3338
- (if prototype extensions are enabled, which is the default behavior):
3378
+ The alternative syntax, with prototype extensions, might look like:
3339
3379
 
3340
3380
  ```js
3341
3381
  fullName() {
@@ -3385,7 +3425,7 @@ enifed('ember-metal/computed', ['exports', 'ember-metal/debug', 'ember-metal/pro
3385
3425
  @public
3386
3426
  */
3387
3427
  function cacheFor(obj, key) {
3388
- var meta = obj.__ember_meta__;
3428
+ var meta = _emberMetalMeta.peekMeta(obj);
3389
3429
  var cache = meta && meta.source === obj && meta.readableCache();
3390
3430
  var ret = cache && cache[key];
3391
3431
 
@@ -3419,7 +3459,7 @@ enifed('ember-metal/computed', ['exports', 'ember-metal/debug', 'ember-metal/pro
3419
3459
  exports.computed = computed;
3420
3460
  exports.cacheFor = cacheFor;
3421
3461
  });
3422
- enifed('ember-metal/computed_macros', ['exports', 'ember-metal/core', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/computed', 'ember-metal/is_empty', 'ember-metal/is_none', 'ember-metal/alias'], function (exports, _emberMetalCore, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalComputed, _emberMetalIs_empty, _emberMetalIs_none, _emberMetalAlias) {
3462
+ enifed('ember-metal/computed_macros', ['exports', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/computed', 'ember-metal/is_empty', 'ember-metal/is_none', 'ember-metal/alias'], function (exports, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalComputed, _emberMetalIs_empty, _emberMetalIs_none, _emberMetalAlias) {
3423
3463
  'use strict';
3424
3464
 
3425
3465
  exports.empty = empty;
@@ -3925,47 +3965,6 @@ enifed('ember-metal/computed_macros', ['exports', 'ember-metal/core', 'ember-met
3925
3965
  });
3926
3966
 
3927
3967
  exports.or = or;
3928
- /**
3929
- A computed property that returns the array of values
3930
- for the provided dependent properties.
3931
-
3932
- Example
3933
-
3934
- ```javascript
3935
- var Hamster = Ember.Object.extend({
3936
- clothes: Ember.computed.collect('hat', 'shirt')
3937
- });
3938
-
3939
- var hamster = Hamster.create();
3940
-
3941
- hamster.get('clothes'); // [null, null]
3942
- hamster.set('hat', 'Camp Hat');
3943
- hamster.set('shirt', 'Camp Shirt');
3944
- hamster.get('clothes'); // ['Camp Hat', 'Camp Shirt']
3945
- ```
3946
-
3947
- @method collect
3948
- @for Ember.computed
3949
- @param {String} dependentKey*
3950
- @return {Ember.ComputedProperty} computed property which maps
3951
- values of all passed in properties to an array.
3952
- @public
3953
- */
3954
- var collect = generateComputedWithProperties(function (properties) {
3955
- var res = _emberMetalCore.default.A();
3956
- for (var key in properties) {
3957
- if (properties.hasOwnProperty(key)) {
3958
- if (_emberMetalIs_none.default(properties[key])) {
3959
- res.push(null);
3960
- } else {
3961
- res.push(properties[key]);
3962
- }
3963
- }
3964
- }
3965
- return res;
3966
- });
3967
-
3968
- exports.collect = collect;
3969
3968
  /**
3970
3969
  Creates a new property that is an alias for another property
3971
3970
  on an object. Calls to `get` or `set` this property behave as
@@ -4136,7 +4135,7 @@ enifed('ember-metal/core', ['exports'], function (exports) {
4136
4135
 
4137
4136
  @class Ember
4138
4137
  @static
4139
- @version 2.2.1
4138
+ @version 2.3.0-beta.1
4140
4139
  @public
4141
4140
  */
4142
4141
 
@@ -4180,11 +4179,11 @@ enifed('ember-metal/core', ['exports'], function (exports) {
4180
4179
 
4181
4180
  @property VERSION
4182
4181
  @type String
4183
- @default '2.2.1'
4182
+ @default '2.3.0-beta.1'
4184
4183
  @static
4185
4184
  @public
4186
4185
  */
4187
- Ember.VERSION = '2.2.1';
4186
+ Ember.VERSION = '2.3.0-beta.1';
4188
4187
 
4189
4188
  /**
4190
4189
  The hash of environment variables used to control various configuration
@@ -4639,7 +4638,7 @@ enifed('ember-metal/events', ['exports', 'ember-metal/debug', 'ember-metal/utils
4639
4638
  }
4640
4639
 
4641
4640
  function accumulateListeners(obj, eventName, otherActions) {
4642
- var meta = obj['__ember_meta__'];
4641
+ var meta = _emberMetalMeta.peekMeta(obj);
4643
4642
  if (!meta) {
4644
4643
  return;
4645
4644
  }
@@ -4799,7 +4798,7 @@ enifed('ember-metal/events', ['exports', 'ember-metal/debug', 'ember-metal/utils
4799
4798
 
4800
4799
  function sendEvent(obj, eventName, params, actions) {
4801
4800
  if (!actions) {
4802
- var meta = obj['__ember_meta__'];
4801
+ var meta = _emberMetalMeta.peekMeta(obj);
4803
4802
  actions = meta && meta.matchingListeners(eventName);
4804
4803
  }
4805
4804
 
@@ -4851,7 +4850,7 @@ enifed('ember-metal/events', ['exports', 'ember-metal/debug', 'ember-metal/utils
4851
4850
  */
4852
4851
 
4853
4852
  function hasListeners(obj, eventName) {
4854
- var meta = obj['__ember_meta__'];
4853
+ var meta = _emberMetalMeta.peekMeta(obj);
4855
4854
  if (!meta) {
4856
4855
  return false;
4857
4856
  }
@@ -4868,7 +4867,7 @@ enifed('ember-metal/events', ['exports', 'ember-metal/debug', 'ember-metal/utils
4868
4867
 
4869
4868
  function listenersFor(obj, eventName) {
4870
4869
  var ret = [];
4871
- var meta = obj['__ember_meta__'];
4870
+ var meta = _emberMetalMeta.peekMeta(obj);
4872
4871
  var actions = meta && meta.matchingListeners(eventName);
4873
4872
 
4874
4873
  if (!actions) {
@@ -5094,7 +5093,7 @@ enifed('ember-metal/get_properties', ['exports', 'ember-metal/property_get'], fu
5094
5093
  return ret;
5095
5094
  }
5096
5095
  });
5097
- enifed('ember-metal/injected_property', ['exports', 'ember-metal/debug', 'ember-metal/computed', 'ember-metal/alias', 'ember-metal/properties'], function (exports, _emberMetalDebug, _emberMetalComputed, _emberMetalAlias, _emberMetalProperties) {
5096
+ enifed('ember-metal/injected_property', ['exports', 'ember-metal/debug', 'ember-metal/computed', 'ember-metal/alias', 'ember-metal/properties', 'container/owner'], function (exports, _emberMetalDebug, _emberMetalComputed, _emberMetalAlias, _emberMetalProperties, _containerOwner) {
5098
5097
  'use strict';
5099
5098
 
5100
5099
  /**
@@ -5118,11 +5117,12 @@ enifed('ember-metal/injected_property', ['exports', 'ember-metal/debug', 'ember-
5118
5117
 
5119
5118
  function injectedPropertyGet(keyName) {
5120
5119
  var desc = this[keyName];
5120
+ var owner = _containerOwner.getOwner(this);
5121
5121
 
5122
5122
  _emberMetalDebug.assert('InjectedProperties should be defined with the Ember.inject computed property macros.', desc && desc.isDescriptor && desc.type);
5123
- _emberMetalDebug.assert('Attempting to lookup an injected property on an object without a container, ensure that the object was instantiated via a container.', this.container);
5123
+ _emberMetalDebug.assert('Attempting to lookup an injected property on an object without a container, ensure that the object was instantiated via a container.', owner);
5124
5124
 
5125
- return this.container.lookup(desc.type + ':' + (desc.name || keyName));
5125
+ return owner.lookup(desc.type + ':' + (desc.name || keyName));
5126
5126
  }
5127
5127
 
5128
5128
  InjectedProperty.prototype = Object.create(_emberMetalProperties.Descriptor.prototype);
@@ -5445,6 +5445,8 @@ enifed('ember-metal/is_empty', ['exports', 'ember-metal/property_get', 'ember-me
5445
5445
  Ember.isEmpty({}); // false
5446
5446
  Ember.isEmpty('Adam Hawkins'); // false
5447
5447
  Ember.isEmpty([0,1,2]); // false
5448
+ Ember.isEmpty('\n\t'); // false
5449
+ Ember.isEmpty(' '); // false
5448
5450
  ```
5449
5451
 
5450
5452
  @method isEmpty
@@ -5611,6 +5613,12 @@ enifed('ember-metal/libraries', ['exports', 'ember-metal/debug', 'ember-metal/fe
5611
5613
  }
5612
5614
  };
5613
5615
 
5616
+ if (_emberMetalFeatures.default('ember-libraries-isregistered')) {
5617
+ Libraries.prototype.isRegistered = function (name) {
5618
+ return !!this._getLibraryByName(name);
5619
+ };
5620
+ }
5621
+
5614
5622
  exports.default = Libraries;
5615
5623
  });
5616
5624
  enifed('ember-metal/logger', ['exports', 'ember-metal/core', 'ember-metal/error'], function (exports, _emberMetalCore, _emberMetalError) {
@@ -6282,6 +6290,9 @@ enifed('ember-metal/merge', ['exports', 'ember-metal/debug', 'ember-metal/featur
6282
6290
  */
6283
6291
 
6284
6292
  function merge(original, updates) {
6293
+ if (_emberMetalFeatures.default('ember-metal-ember-assign')) {
6294
+ _emberMetalDebug.deprecate('Usage of `Ember.merge` is deprecated, use `Ember.assign` instead.', false, { id: 'ember-metal.merge', until: '3.0.0' });
6295
+ }
6285
6296
 
6286
6297
  if (!updates || typeof updates !== 'object') {
6287
6298
  return original;
@@ -6305,6 +6316,8 @@ enifed('ember-metal/meta', ['exports', 'ember-metal/meta_listeners', 'ember-meta
6305
6316
  // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed
6306
6317
 
6307
6318
  exports.meta = meta;
6319
+ exports.peekMeta = peekMeta;
6320
+ exports.deleteMeta = deleteMeta;
6308
6321
 
6309
6322
  /**
6310
6323
  @module ember-metal
@@ -6343,6 +6356,7 @@ enifed('ember-metal/meta', ['exports', 'ember-metal/meta_listeners', 'ember-meta
6343
6356
  };
6344
6357
 
6345
6358
  var memberNames = Object.keys(members);
6359
+ var META_FIELD = '__ember_meta__';
6346
6360
 
6347
6361
  function Meta(obj, parentMeta) {
6348
6362
  this._cache = undefined;
@@ -6601,14 +6615,25 @@ enifed('ember-metal/meta', ['exports', 'ember-metal/meta_listeners', 'ember-meta
6601
6615
 
6602
6616
  exports.META_DESC = META_DESC;
6603
6617
  var EMBER_META_PROPERTY = {
6604
- name: '__ember_meta__',
6618
+ name: META_FIELD,
6605
6619
  descriptor: META_DESC
6606
6620
  };
6607
6621
 
6608
- // Placeholder for non-writable metas.
6609
- var EMPTY_META = new Meta(null);
6622
+ // choose the one appropriate for given platform
6623
+ var setMeta = function (obj, meta) {
6624
+ // if `null` already, just set it to the new value
6625
+ // otherwise define property first
6626
+ if (obj[META_FIELD] !== null) {
6627
+ if (obj.__defineNonEnumerable) {
6628
+ obj.__defineNonEnumerable(EMBER_META_PROPERTY);
6629
+ } else {
6630
+ Object.defineProperty(obj, META_FIELD, META_DESC);
6631
+ }
6632
+ }
6633
+
6634
+ obj[META_FIELD] = meta;
6635
+ };
6610
6636
 
6611
- exports.EMPTY_META = EMPTY_META;
6612
6637
  /**
6613
6638
  Retrieves the meta hash for an object. If `writable` is true ensures the
6614
6639
  hash is writable for this object as well.
@@ -6628,34 +6653,32 @@ enifed('ember-metal/meta', ['exports', 'ember-metal/meta_listeners', 'ember-meta
6628
6653
  @return {Object} the meta hash for an object
6629
6654
  */
6630
6655
 
6631
- function meta(obj, writable) {
6632
- var ret = obj.__ember_meta__;
6633
- if (writable === false) {
6634
- return ret || EMPTY_META;
6635
- }
6656
+ function meta(obj) {
6657
+ var maybeMeta = peekMeta(obj);
6658
+ var parent = undefined;
6636
6659
 
6637
- if (ret && ret.source === obj) {
6638
- return ret;
6660
+ // remove this code, in-favor of explicit parent
6661
+ if (maybeMeta) {
6662
+ if (maybeMeta.source === obj) {
6663
+ return maybeMeta;
6664
+ }
6665
+ parent = maybeMeta;
6639
6666
  }
6640
6667
 
6641
- if (!ret) {
6642
- ret = new Meta(obj);
6643
- } else {
6644
- ret = new Meta(obj, ret);
6645
- }
6668
+ var newMeta = new Meta(obj, parent);
6669
+ setMeta(obj, newMeta);
6670
+ return newMeta;
6671
+ }
6646
6672
 
6647
- // if `null` already, just set it to the new value
6648
- // otherwise define property first
6649
- if (obj.__ember_meta__ !== null) {
6650
- if (obj.__defineNonEnumerable) {
6651
- obj.__defineNonEnumerable(EMBER_META_PROPERTY);
6652
- } else {
6653
- Object.defineProperty(obj, '__ember_meta__', META_DESC);
6654
- }
6655
- }
6656
- obj.__ember_meta__ = ret;
6673
+ function peekMeta(obj) {
6674
+ return obj[META_FIELD];
6675
+ }
6657
6676
 
6658
- return ret;
6677
+ function deleteMeta(obj) {
6678
+ if (typeof obj[META_FIELD] !== 'object') {
6679
+ return;
6680
+ }
6681
+ obj[META_FIELD] = null;
6659
6682
  }
6660
6683
  });
6661
6684
  enifed('ember-metal/meta_listeners', ['exports'], function (exports) {
@@ -6840,7 +6863,6 @@ enifed('ember-metal/mixin', ['exports', 'ember-metal/core', 'ember-metal/error',
6840
6863
  @module ember
6841
6864
  @submodule ember-metal
6842
6865
  */
6843
-
6844
6866
  exports.mixin = mixin;
6845
6867
  exports.default = Mixin;
6846
6868
  exports.required = required;
@@ -7330,6 +7352,10 @@ enifed('ember-metal/mixin', ['exports', 'ember-metal/core', 'ember-metal/error',
7330
7352
  this.mixins = undefined;
7331
7353
  }
7332
7354
  this.ownerConstructor = undefined;
7355
+ this._without = undefined;
7356
+ this[_emberMetalUtils.GUID_KEY] = null;
7357
+ this[_emberMetalUtils.GUID_KEY + '_name'] = null;
7358
+ _emberMetalDebug.debugSeal(this);
7333
7359
  }
7334
7360
 
7335
7361
  Mixin._apply = applyMixin;
@@ -7446,7 +7472,7 @@ enifed('ember-metal/mixin', ['exports', 'ember-metal/core', 'ember-metal/error',
7446
7472
  if (obj instanceof Mixin) {
7447
7473
  return _detect(obj, this, {});
7448
7474
  }
7449
- var m = obj.__ember_meta__;
7475
+ var m = _emberMetalMeta.peekMeta(obj);
7450
7476
  if (!m) {
7451
7477
  return false;
7452
7478
  }
@@ -7497,10 +7523,12 @@ enifed('ember-metal/mixin', ['exports', 'ember-metal/core', 'ember-metal/error',
7497
7523
  return ret;
7498
7524
  };
7499
7525
 
7526
+ _emberMetalDebug.debugSeal(MixinPrototype);
7527
+
7500
7528
  // returns the mixins currently applied to the specified object
7501
7529
  // TODO: Make Ember.mixin
7502
7530
  Mixin.mixins = function (obj) {
7503
- var m = obj['__ember_meta__'];
7531
+ var m = _emberMetalMeta.peekMeta(obj);
7504
7532
  var ret = [];
7505
7533
  if (!m) {
7506
7534
  return ret;
@@ -7591,7 +7619,7 @@ enifed('ember-metal/mixin', ['exports', 'ember-metal/core', 'ember-metal/error',
7591
7619
  @param {String} propertyNames*
7592
7620
  @param {Function} func
7593
7621
  @return func
7594
- @private
7622
+ @public
7595
7623
  */
7596
7624
 
7597
7625
  function observer() {
@@ -8100,10 +8128,10 @@ enifed('ember-metal/properties', ['exports', 'ember-metal/debug', 'ember-metal/f
8100
8128
  return this;
8101
8129
  }
8102
8130
  });
8103
- enifed('ember-metal/property_events', ['exports', 'ember-metal/utils', 'ember-metal/events', 'ember-metal/observer_set'], function (exports, _emberMetalUtils, _emberMetalEvents, _emberMetalObserver_set) {
8131
+ enifed('ember-metal/property_events', ['exports', 'ember-metal/utils', 'ember-metal/meta', 'ember-metal/events', 'ember-metal/observer_set', 'ember-metal/symbol'], function (exports, _emberMetalUtils, _emberMetalMeta, _emberMetalEvents, _emberMetalObserver_set, _emberMetalSymbol) {
8104
8132
  'use strict';
8105
8133
 
8106
- var PROPERTY_DID_CHANGE = _emberMetalUtils.symbol('PROPERTY_DID_CHANGE');
8134
+ var PROPERTY_DID_CHANGE = _emberMetalSymbol.default('PROPERTY_DID_CHANGE');
8107
8135
 
8108
8136
  exports.PROPERTY_DID_CHANGE = PROPERTY_DID_CHANGE;
8109
8137
  var beforeObserverSet = new _emberMetalObserver_set.default();
@@ -8131,7 +8159,7 @@ enifed('ember-metal/property_events', ['exports', 'ember-metal/utils', 'ember-me
8131
8159
  @private
8132
8160
  */
8133
8161
  function propertyWillChange(obj, keyName) {
8134
- var m = obj['__ember_meta__'];
8162
+ var m = _emberMetalMeta.peekMeta(obj);
8135
8163
  var watching = m && m.peekWatching(keyName) > 0 || keyName === 'length';
8136
8164
  var proto = m && m.proto;
8137
8165
  var possibleDesc = obj[keyName];
@@ -8171,7 +8199,7 @@ enifed('ember-metal/property_events', ['exports', 'ember-metal/utils', 'ember-me
8171
8199
  @private
8172
8200
  */
8173
8201
  function propertyDidChange(obj, keyName) {
8174
- var m = obj['__ember_meta__'];
8202
+ var m = _emberMetalMeta.peekMeta(obj);
8175
8203
  var watching = m && m.peekWatching(keyName) > 0 || keyName === 'length';
8176
8204
  var proto = m && m.proto;
8177
8205
  var possibleDesc = obj[keyName];
@@ -8383,7 +8411,7 @@ enifed('ember-metal/property_events', ['exports', 'ember-metal/utils', 'ember-me
8383
8411
  exports.endPropertyChanges = endPropertyChanges;
8384
8412
  exports.changeProperties = changeProperties;
8385
8413
  });
8386
- enifed('ember-metal/property_get', ['exports', 'ember-metal/core', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/error', 'ember-metal/path_cache'], function (exports, _emberMetalCore, _emberMetalDebug, _emberMetalFeatures, _emberMetalError, _emberMetalPath_cache) {
8414
+ enifed('ember-metal/property_get', ['exports', 'ember-metal/core', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/error', 'ember-metal/path_cache', 'ember-metal/meta'], function (exports, _emberMetalCore, _emberMetalDebug, _emberMetalFeatures, _emberMetalError, _emberMetalPath_cache, _emberMetalMeta) {
8387
8415
  /**
8388
8416
  @module ember-metal
8389
8417
  */
@@ -8441,9 +8469,9 @@ enifed('ember-metal/property_get', ['exports', 'ember-metal/core', 'ember-metal/
8441
8469
  return obj;
8442
8470
  }
8443
8471
 
8444
- var meta = obj['__ember_meta__'];
8445
- var possibleDesc = obj[keyName];
8446
- var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined;
8472
+ var meta = _emberMetalMeta.peekMeta(obj);
8473
+ var value = obj[keyName];
8474
+ var desc = value !== null && typeof value === 'object' && value.isDescriptor ? value : undefined;
8447
8475
  var ret;
8448
8476
 
8449
8477
  if (desc === undefined && _emberMetalPath_cache.isPath(keyName)) {
@@ -8456,7 +8484,7 @@ enifed('ember-metal/property_get', ['exports', 'ember-metal/core', 'ember-metal/
8456
8484
  if (meta && meta.peekWatching(keyName) > 0) {
8457
8485
  ret = meta.peekValues(keyName);
8458
8486
  } else {
8459
- ret = obj[keyName];
8487
+ ret = value;
8460
8488
  }
8461
8489
 
8462
8490
  if (ret === undefined && 'object' === typeof obj && !(keyName in obj) && 'function' === typeof obj.unknownProperty) {
@@ -8540,6 +8568,23 @@ enifed('ember-metal/property_get', ['exports', 'ember-metal/core', 'ember-metal/
8540
8568
  return root;
8541
8569
  }
8542
8570
 
8571
+ /**
8572
+ Retrieves the value of a property from an Object, or a default value in the
8573
+ case that the property returns `undefined`.
8574
+
8575
+ ```javascript
8576
+ Ember.getWithDefault(person, 'lastName', 'Doe');
8577
+ ```
8578
+
8579
+ @method getWithDefault
8580
+ @for Ember
8581
+ @param {Object} obj The object to retrieve from.
8582
+ @param {String} keyName The name of the property to retrieve
8583
+ @param {Object} defaultValue The value to return if the property value is undefined
8584
+ @return {Object} The property value or the defaultValue.
8585
+ @public
8586
+ */
8587
+
8543
8588
  function getWithDefault(root, key, defaultValue) {
8544
8589
  var value = get(root, key);
8545
8590
 
@@ -8551,7 +8596,7 @@ enifed('ember-metal/property_get', ['exports', 'ember-metal/core', 'ember-metal/
8551
8596
 
8552
8597
  exports.default = get;
8553
8598
  });
8554
- enifed('ember-metal/property_set', ['exports', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_events', 'ember-metal/properties', 'ember-metal/error', 'ember-metal/path_cache'], function (exports, _emberMetalDebug, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_events, _emberMetalProperties, _emberMetalError, _emberMetalPath_cache) {
8599
+ enifed('ember-metal/property_set', ['exports', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_events', 'ember-metal/properties', 'ember-metal/error', 'ember-metal/path_cache', 'ember-metal/meta'], function (exports, _emberMetalDebug, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_events, _emberMetalProperties, _emberMetalError, _emberMetalPath_cache, _emberMetalMeta) {
8555
8600
  'use strict';
8556
8601
 
8557
8602
  exports.set = set;
@@ -8580,7 +8625,7 @@ enifed('ember-metal/property_set', ['exports', 'ember-metal/debug', 'ember-metal
8580
8625
 
8581
8626
  var meta, possibleDesc, desc;
8582
8627
  if (obj) {
8583
- meta = obj['__ember_meta__'];
8628
+ meta = _emberMetalMeta.peekMeta(obj);
8584
8629
  possibleDesc = obj[keyName];
8585
8630
  desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined;
8586
8631
  }
@@ -9548,7 +9593,11 @@ enifed('ember-metal/streams/dependency', ['exports', 'ember-metal/debug', 'ember
9548
9593
  enifed('ember-metal/streams/key-stream', ['exports', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/observer', 'ember-metal/streams/stream', 'ember-metal/streams/utils'], function (exports, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalObserver, _emberMetalStreamsStream, _emberMetalStreamsUtils) {
9549
9594
  'use strict';
9550
9595
 
9551
- var KeyStream = _emberMetalStreamsStream.default.extend({
9596
+ function labelFor(source, key) {
9597
+ return source.label ? source.label + '.' + key : key;
9598
+ }
9599
+
9600
+ exports.default = _emberMetalStreamsStream.default.extend({
9552
9601
  init: function (source, key) {
9553
9602
  _emberMetalDebug.assert('KeyStream error: source must be a stream', _emberMetalStreamsUtils.isStream(source)); // TODO: This isn't necessary.
9554
9603
  _emberMetalDebug.assert('KeyStream error: key must be a non-empty string', typeof key === 'string' && key.length > 0);
@@ -9565,9 +9614,17 @@ enifed('ember-metal/streams/key-stream', ['exports', 'ember-metal/debug', 'ember
9565
9614
 
9566
9615
  compute: function () {
9567
9616
  var object = this.sourceDep.getValue();
9568
- if (object) {
9617
+ var type = typeof object;
9618
+
9619
+ if (!object || type === 'boolean') {
9620
+ return;
9621
+ }
9622
+
9623
+ if (type === 'object') {
9569
9624
  return _emberMetalProperty_get.get(object, this.key);
9570
9625
  }
9626
+
9627
+ return object[this.key];
9571
9628
  },
9572
9629
 
9573
9630
  setValue: function (value) {
@@ -9612,12 +9669,6 @@ enifed('ember-metal/streams/key-stream', ['exports', 'ember-metal/debug', 'ember
9612
9669
  this._clearObservedObject();
9613
9670
  }
9614
9671
  });
9615
-
9616
- function labelFor(source, key) {
9617
- return source.label ? source.label + '.' + key : key;
9618
- }
9619
-
9620
- exports.default = KeyStream;
9621
9672
  });
9622
9673
  enifed('ember-metal/streams/proxy-stream', ['exports', 'ember-runtime/system/object', 'ember-metal/streams/stream'], function (exports, _emberRuntimeSystemObject, _emberMetalStreamsStream) {
9623
9674
  'use strict';
@@ -9651,7 +9702,7 @@ enifed('ember-metal/streams/proxy-stream', ['exports', 'ember-runtime/system/obj
9651
9702
 
9652
9703
  exports.default = ProxyStream;
9653
9704
  });
9654
- enifed('ember-metal/streams/stream', ['exports', 'ember-metal/core', 'ember-metal/assign', 'ember-metal/debug', 'ember-metal/path_cache', 'ember-metal/observer', 'ember-metal/streams/utils', 'ember-metal/empty_object', 'ember-metal/streams/subscriber', 'ember-metal/streams/dependency', 'ember-metal/utils'], function (exports, _emberMetalCore, _emberMetalAssign, _emberMetalDebug, _emberMetalPath_cache, _emberMetalObserver, _emberMetalStreamsUtils, _emberMetalEmpty_object, _emberMetalStreamsSubscriber, _emberMetalStreamsDependency, _emberMetalUtils) {
9705
+ enifed('ember-metal/streams/stream', ['exports', 'ember-metal/assign', 'ember-metal/debug', 'ember-metal/path_cache', 'ember-metal/observer', 'ember-metal/streams/utils', 'ember-metal/empty_object', 'ember-metal/streams/subscriber', 'ember-metal/streams/dependency', 'ember-metal/utils', 'require'], function (exports, _emberMetalAssign, _emberMetalDebug, _emberMetalPath_cache, _emberMetalObserver, _emberMetalStreamsUtils, _emberMetalEmpty_object, _emberMetalStreamsSubscriber, _emberMetalStreamsDependency, _emberMetalUtils, _require) {
9655
9706
  'use strict';
9656
9707
 
9657
9708
  exports.wrap = wrap;
@@ -9693,7 +9744,7 @@ enifed('ember-metal/streams/stream', ['exports', 'ember-metal/core', 'ember-meta
9693
9744
  },
9694
9745
 
9695
9746
  _makeChildStream: function (key) {
9696
- KeyStream = KeyStream || _emberMetalCore.default.__loader.require('ember-metal/streams/key-stream').default;
9747
+ KeyStream = KeyStream || _require.default('ember-metal/streams/key-stream').default;
9697
9748
  return new KeyStream(this, key);
9698
9749
  },
9699
9750
 
@@ -9833,7 +9884,7 @@ enifed('ember-metal/streams/stream', ['exports', 'ember-metal/core', 'ember-meta
9833
9884
  if (value !== this.observedProxy) {
9834
9885
  this._clearObservedProxy();
9835
9886
 
9836
- ProxyMixin = ProxyMixin || _emberMetalCore.default.__loader.require('ember-runtime/mixins/-proxy').default;
9887
+ ProxyMixin = ProxyMixin || _require.default('ember-runtime/mixins/-proxy').default;
9837
9888
 
9838
9889
  if (ProxyMixin.detect(value)) {
9839
9890
  _emberMetalObserver.addObserver(value, 'content', this, this.notify);
@@ -10428,8 +10479,18 @@ enifed('ember-metal/streams/utils', ['exports', 'ember-metal/debug', 'ember-meta
10428
10479
  }
10429
10480
  }
10430
10481
  });
10431
- enifed("ember-metal/symbol", ["exports"], function (exports) {
10432
- "use strict";
10482
+ enifed('ember-metal/symbol', ['exports', 'ember-metal/utils'], function (exports, _emberMetalUtils) {
10483
+ 'use strict';
10484
+
10485
+ exports.default = symbol;
10486
+
10487
+ function symbol(debugName) {
10488
+ // TODO: Investigate using platform symbols, but we do not
10489
+ // want to require non-enumerability for this API, which
10490
+ // would introduce a large cost.
10491
+
10492
+ return _emberMetalUtils.intern(debugName + ' [id=' + _emberMetalUtils.GUID_KEY + Math.floor(Math.random() * new Date()) + ']');
10493
+ }
10433
10494
  });
10434
10495
  enifed('ember-metal/utils', ['exports'], function (exports) {
10435
10496
  'no use strict';
@@ -10448,7 +10509,7 @@ enifed('ember-metal/utils', ['exports'], function (exports) {
10448
10509
  @return {Number} the uuid
10449
10510
  */
10450
10511
  exports.uuid = uuid;
10451
- exports.symbol = symbol;
10512
+ exports.intern = intern;
10452
10513
  exports.generateGuid = generateGuid;
10453
10514
  exports.guidFor = guidFor;
10454
10515
  exports.wrap = wrap;
@@ -10525,6 +10586,7 @@ enifed('ember-metal/utils', ['exports'], function (exports) {
10525
10586
  @private
10526
10587
  @return {String} interned version of the provided string
10527
10588
  */
10589
+
10528
10590
  function intern(str) {
10529
10591
  var obj = {};
10530
10592
  obj[str] = 1;
@@ -10536,14 +10598,6 @@ enifed('ember-metal/utils', ['exports'], function (exports) {
10536
10598
  return str;
10537
10599
  }
10538
10600
 
10539
- function symbol(debugName) {
10540
- // TODO: Investigate using platform symbols, but we do not
10541
- // want to require non-enumerability for this API, which
10542
- // would introduce a large cost.
10543
-
10544
- return intern(debugName + ' [id=' + GUID_KEY + Math.floor(Math.random() * new Date()) + ']');
10545
- }
10546
-
10547
10601
  /**
10548
10602
  A unique key used to assign guids and other private metadata to objects.
10549
10603
  If you inspect an object in your browser debugger you will often see these.
@@ -11006,6 +11060,9 @@ enifed('ember-metal/watch_key', ['exports', 'ember-metal/features', 'ember-metal
11006
11060
  exports.watchKey = watchKey;
11007
11061
  exports.unwatchKey = unwatchKey;
11008
11062
 
11063
+ var handleMandatorySetter = undefined,
11064
+ lookupDescriptor = undefined;
11065
+
11009
11066
  function watchKey(obj, keyName, meta) {
11010
11067
  // can't watch length on Array - it is special...
11011
11068
  if (keyName === 'length' && Array.isArray(obj)) {
@@ -11034,8 +11091,23 @@ enifed('ember-metal/watch_key', ['exports', 'ember-metal/features', 'ember-metal
11034
11091
  }
11035
11092
  }
11036
11093
 
11037
- var handleMandatorySetter = function handleMandatorySetter(m, obj, keyName) {
11038
- var descriptor = Object.getOwnPropertyDescriptor && Object.getOwnPropertyDescriptor(obj, keyName);
11094
+ lookupDescriptor = function lookupDescriptor(obj, keyName) {
11095
+ var current = obj;
11096
+ while (current) {
11097
+ var descriptor = Object.getOwnPropertyDescriptor(current, keyName);
11098
+
11099
+ if (descriptor) {
11100
+ return descriptor;
11101
+ }
11102
+
11103
+ current = Object.getPrototypeOf(current);
11104
+ }
11105
+
11106
+ return null;
11107
+ };
11108
+
11109
+ handleMandatorySetter = function handleMandatorySetter(m, obj, keyName) {
11110
+ var descriptor = lookupDescriptor(obj, keyName);
11039
11111
  var configurable = descriptor ? descriptor.configurable : true;
11040
11112
  var isWritable = descriptor ? descriptor.writable : true;
11041
11113
  var hasValue = descriptor ? 'value' in descriptor : true;
@@ -11142,7 +11214,7 @@ enifed('ember-metal/watch_path', ['exports', 'ember-metal/meta', 'ember-metal/ch
11142
11214
  }
11143
11215
  }
11144
11216
  });
11145
- enifed('ember-metal/watching', ['exports', 'ember-metal/chains', 'ember-metal/watch_key', 'ember-metal/watch_path', 'ember-metal/path_cache'], function (exports, _emberMetalChains, _emberMetalWatch_key, _emberMetalWatch_path, _emberMetalPath_cache) {
11217
+ enifed('ember-metal/watching', ['exports', 'ember-metal/chains', 'ember-metal/watch_key', 'ember-metal/watch_path', 'ember-metal/path_cache', 'ember-metal/meta'], function (exports, _emberMetalChains, _emberMetalWatch_key, _emberMetalWatch_path, _emberMetalPath_cache, _emberMetalMeta) {
11146
11218
  /**
11147
11219
  @module ember-metal
11148
11220
  */
@@ -11182,7 +11254,7 @@ enifed('ember-metal/watching', ['exports', 'ember-metal/chains', 'ember-metal/wa
11182
11254
  exports.watch = watch;
11183
11255
 
11184
11256
  function isWatching(obj, key) {
11185
- var meta = obj['__ember_meta__'];
11257
+ var meta = _emberMetalMeta.peekMeta(obj);
11186
11258
  return (meta && meta.peekWatching(key)) > 0;
11187
11259
  }
11188
11260
 
@@ -11215,11 +11287,11 @@ enifed('ember-metal/watching', ['exports', 'ember-metal/chains', 'ember-metal/wa
11215
11287
  */
11216
11288
 
11217
11289
  function destroy(obj) {
11218
- var meta = obj['__ember_meta__'];
11290
+ var meta = _emberMetalMeta.peekMeta(obj);
11219
11291
  var node, nodes, key, nodeObject;
11220
11292
 
11221
11293
  if (meta) {
11222
- obj['__ember_meta__'] = null;
11294
+ _emberMetalMeta.deleteMeta(obj);
11223
11295
  // remove chainWatchers to remove circular references that would prevent GC
11224
11296
  node = meta.readableChains();
11225
11297
  if (node) {
@@ -11303,9 +11375,9 @@ enifed('ember-metal', ['exports', 'ember-metal/core', 'ember-metal/debug', 'embe
11303
11375
  _emberMetalCore.default.Error = _emberMetalError.default;
11304
11376
  _emberMetalCore.default.guidFor = _emberMetalUtils.guidFor;
11305
11377
  _emberMetalCore.default.META_DESC = _emberMetalMeta.META_DESC;
11306
- _emberMetalCore.default.EMPTY_META = _emberMetalMeta.EMPTY_META;
11307
11378
  _emberMetalCore.default.meta = _emberMetalMeta.meta;
11308
11379
  _emberMetalCore.default.inspect = _emberMetalUtils.inspect;
11380
+
11309
11381
  _emberMetalCore.default.tryCatchFinally = _emberMetalUtils.deprecatedTryCatchFinally;
11310
11382
  _emberMetalCore.default.makeArray = _emberMetalUtils.makeArray;
11311
11383
  _emberMetalCore.default.canInvoke = _emberMetalUtils.canInvoke;
@@ -11415,7 +11487,12 @@ enifed('ember-metal', ['exports', 'ember-metal/core', 'ember-metal/debug', 'embe
11415
11487
  _emberMetalCore.default.isBlank = _emberMetalIs_blank.default;
11416
11488
  _emberMetalCore.default.isPresent = _emberMetalIs_present.default;
11417
11489
 
11418
- _emberMetalCore.default.merge = _emberMetalMerge.default;
11490
+ if (_emberMetalFeatures.default('ember-metal-ember-assign')) {
11491
+ _emberMetalCore.default.assign = Object.assign || _emberMetalAssign.default;
11492
+ _emberMetalCore.default.merge = _emberMetalMerge.default;
11493
+ } else {
11494
+ _emberMetalCore.default.merge = _emberMetalMerge.default;
11495
+ }
11419
11496
 
11420
11497
  _emberMetalCore.default.FEATURES = _emberMetalFeatures.FEATURES;
11421
11498
  _emberMetalCore.default.FEATURES.isEnabled = _emberMetalFeatures.default;
@@ -12338,6 +12415,9 @@ enifed('ember-template-compiler/plugins/transform-top-level-components', ['expor
12338
12415
 
12339
12416
  if (lastComponentNode.type === 'ComponentNode') {
12340
12417
  componentCallback(lastComponentNode);
12418
+ } else if (_emberMetalFeatures.default('ember-htmlbars-component-generation')) {
12419
+ var component = elementCallback(lastComponentNode);
12420
+ body.splice(lastIndex, 1, component);
12341
12421
  }
12342
12422
  }
12343
12423
 
@@ -12490,6 +12570,9 @@ enifed('ember-template-compiler/system/compile_options', ['exports', 'ember-meta
12490
12570
 
12491
12571
  exports.default = function (_options) {
12492
12572
  var disableComponentGeneration = true;
12573
+ if (_emberMetalFeatures.default('ember-htmlbars-component-generation')) {
12574
+ disableComponentGeneration = false;
12575
+ }
12493
12576
 
12494
12577
  var options = undefined;
12495
12578
  // When calling `Ember.Handlebars.compile()` a second argument of `true`
@@ -12515,7 +12598,7 @@ enifed('ember-template-compiler/system/compile_options', ['exports', 'ember-meta
12515
12598
  options.buildMeta = function buildMeta(program) {
12516
12599
  return {
12517
12600
  fragmentReason: fragmentReason(program),
12518
- revision: 'Ember@2.2.1',
12601
+ revision: 'Ember@2.3.0-beta.1',
12519
12602
  loc: program.loc,
12520
12603
  moduleName: options.moduleName
12521
12604
  };
@@ -19592,8 +19675,8 @@ enifed('morph-range', ['exports', 'morph-range/utils'], function (exports, _morp
19592
19675
  return this.setNode(content);
19593
19676
  }
19594
19677
  /* Handlebars.SafeString */
19595
- if (typeof content.toHTML === 'function') {
19596
- return this.setHTML(content.toHTML());
19678
+ if (typeof content.string === 'string') {
19679
+ return this.setHTML(content.string);
19597
19680
  }
19598
19681
  if (this.parseTextAsHTML) {
19599
19682
  return this.setHTML(content.toString());