ember-source 2.16.0 → 2.16.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/dist/ember-runtime.js +356 -202
- data/dist/ember-template-compiler.js +443 -255
- data/dist/ember-testing.js +74 -59
- data/dist/ember-tests.js +162 -42
- data/dist/ember-tests.prod.js +157 -46
- data/dist/ember.debug.js +804 -629
- data/dist/ember.min.js +11 -11
- data/dist/ember.prod.js +743 -567
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32904c39bf4645df84aaa32684719aca56947dfb
|
4
|
+
data.tar.gz: 45044a3f4272492ae8542a926e2418abea44518f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d392ac2f69a378a36ce85475a41dcff567a796e975df5c8a340ef4d43b498d78d93daa1cc11e5db118c8e1aa68d6ccb67dd387260ce00973c31b43ce0334e24d
|
7
|
+
data.tar.gz: 8b4231fbecf3a1b99c3ec9070881c4ce35dea2821eb6a8eb37943172f38d22a953b5be47813d4383872577a78c3aba49bcdd875daa0f2108226b48c94e469004
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.16.
|
1
|
+
2.16.1
|
data/dist/ember-runtime.js
CHANGED
@@ -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.16.
|
9
|
+
* @version 2.16.1
|
10
10
|
*/
|
11
11
|
|
12
12
|
var enifed, requireModule, Ember;
|
@@ -1396,7 +1396,6 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
1396
1396
|
|
1397
1397
|
/**
|
1398
1398
|
@module ember
|
1399
|
-
@submodule ember-metal
|
1400
1399
|
*/
|
1401
1400
|
|
1402
1401
|
/**
|
@@ -1579,8 +1578,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
1579
1578
|
}
|
1580
1579
|
|
1581
1580
|
/**
|
1582
|
-
@module ember
|
1583
|
-
@submodule ember-metal
|
1581
|
+
@module @ember/object
|
1584
1582
|
*/
|
1585
1583
|
/*
|
1586
1584
|
The event system uses a series of nested hashes to store listeners on an
|
@@ -1604,7 +1602,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
1604
1602
|
Add an event listener
|
1605
1603
|
|
1606
1604
|
@method addListener
|
1607
|
-
@
|
1605
|
+
@static
|
1606
|
+
@for @ember/object/events
|
1608
1607
|
@param obj
|
1609
1608
|
@param {String} eventName
|
1610
1609
|
@param {Object|Function} target A target object or a function
|
@@ -1613,7 +1612,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
1613
1612
|
@public
|
1614
1613
|
*/
|
1615
1614
|
function addListener(obj, eventName, target, method, once) {
|
1616
|
-
true && !(!!obj && !!eventName) && emberDebug.assert('You must pass at least an object and event name to
|
1615
|
+
true && !(!!obj && !!eventName) && emberDebug.assert('You must pass at least an object and event name to addListener', !!obj && !!eventName);
|
1617
1616
|
true && !(eventName !== 'didInitAttrs') && emberDebug.deprecate('didInitAttrs called in ' + (obj && obj.toString && obj.toString()) + '.', eventName !== 'didInitAttrs', {
|
1618
1617
|
id: 'ember-views.did-init-attrs',
|
1619
1618
|
until: '3.0.0',
|
@@ -1640,10 +1639,11 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
1640
1639
|
/**
|
1641
1640
|
Remove an event listener
|
1642
1641
|
|
1643
|
-
Arguments should match those passed to `
|
1642
|
+
Arguments should match those passed to `addListener`.
|
1644
1643
|
|
1645
1644
|
@method removeListener
|
1646
|
-
@
|
1645
|
+
@static
|
1646
|
+
@for @ember/object/events
|
1647
1647
|
@param obj
|
1648
1648
|
@param {String} eventName
|
1649
1649
|
@param {Object|Function} target A target object or a function
|
@@ -1651,7 +1651,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
1651
1651
|
@public
|
1652
1652
|
*/
|
1653
1653
|
function removeListener(obj, eventName, target, method) {
|
1654
|
-
true && !(!!obj && !!eventName) && emberDebug.assert('You must pass at least an object and event name to
|
1654
|
+
true && !(!!obj && !!eventName) && emberDebug.assert('You must pass at least an object and event name to removeListener', !!obj && !!eventName);
|
1655
1655
|
|
1656
1656
|
if (!method && 'function' === typeof target) {
|
1657
1657
|
method = target;
|
@@ -1671,7 +1671,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
1671
1671
|
setting that property.
|
1672
1672
|
|
1673
1673
|
@method suspendListener
|
1674
|
-
@
|
1674
|
+
@static
|
1675
|
+
@for @ember/object/events
|
1675
1676
|
|
1676
1677
|
@private
|
1677
1678
|
@param obj
|
@@ -1688,7 +1689,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
1688
1689
|
Suspends multiple listeners during a callback.
|
1689
1690
|
|
1690
1691
|
@method suspendListeners
|
1691
|
-
@
|
1692
|
+
@static
|
1693
|
+
@for @ember/object/events
|
1692
1694
|
|
1693
1695
|
@private
|
1694
1696
|
@param obj
|
@@ -1710,7 +1712,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
1710
1712
|
|
1711
1713
|
@private
|
1712
1714
|
@method watchedEvents
|
1713
|
-
@
|
1715
|
+
@static
|
1716
|
+
@for @ember/object/events
|
1714
1717
|
@param obj
|
1715
1718
|
*/
|
1716
1719
|
function watchedEvents(obj) {
|
@@ -1725,7 +1728,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
1725
1728
|
is not passed, the actions stored on the passed object are invoked.
|
1726
1729
|
|
1727
1730
|
@method sendEvent
|
1728
|
-
@
|
1731
|
+
@static
|
1732
|
+
@for @ember/object/events
|
1729
1733
|
@param obj
|
1730
1734
|
@param {String} eventName
|
1731
1735
|
@param {Array} params Optional parameters for each listener.
|
@@ -1782,7 +1786,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
1782
1786
|
/**
|
1783
1787
|
@private
|
1784
1788
|
@method hasListeners
|
1785
|
-
@
|
1789
|
+
@static
|
1790
|
+
@for @ember/object/events
|
1786
1791
|
@param obj
|
1787
1792
|
@param {String} eventName
|
1788
1793
|
*/
|
@@ -1798,7 +1803,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
1798
1803
|
/**
|
1799
1804
|
@private
|
1800
1805
|
@method listenersFor
|
1801
|
-
@
|
1806
|
+
@static
|
1807
|
+
@for @ember/object/events
|
1802
1808
|
@param obj
|
1803
1809
|
@param {String} eventName
|
1804
1810
|
*/
|
@@ -1826,19 +1832,24 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
1826
1832
|
|
1827
1833
|
|
1828
1834
|
``` javascript
|
1829
|
-
|
1830
|
-
|
1835
|
+
import EmberObject from '@ember/object';
|
1836
|
+
import { on } from '@ember/object/evented';
|
1837
|
+
import { sendEvent } from '@ember/object/events';
|
1838
|
+
|
1839
|
+
let Job = EmberObject.extend({
|
1840
|
+
logCompleted: on('completed', function() {
|
1831
1841
|
console.log('Job completed!');
|
1832
1842
|
})
|
1833
1843
|
});
|
1834
1844
|
|
1835
1845
|
let job = Job.create();
|
1836
1846
|
|
1837
|
-
|
1847
|
+
sendEvent(job, 'completed'); // Logs 'Job completed!'
|
1838
1848
|
```
|
1839
1849
|
|
1840
1850
|
@method on
|
1841
|
-
@
|
1851
|
+
@static
|
1852
|
+
@for @ember/object/evented
|
1842
1853
|
@param {String} eventNames*
|
1843
1854
|
@param {Function} func
|
1844
1855
|
@return func
|
@@ -1852,10 +1863,10 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
1852
1863
|
var func = args.pop();
|
1853
1864
|
var events = args;
|
1854
1865
|
|
1855
|
-
true && !(typeof func === 'function') && emberDebug.assert('
|
1866
|
+
true && !(typeof func === 'function') && emberDebug.assert('on expects function as last argument', typeof func === 'function');
|
1856
1867
|
true && !(events.length > 0 && events.every(function (p) {
|
1857
1868
|
return typeof p === 'string' && p.length;
|
1858
|
-
})) && emberDebug.assert('
|
1869
|
+
})) && emberDebug.assert('on called without valid event names', events.length > 0 && events.every(function (p) {
|
1859
1870
|
return typeof p === 'string' && p.length;
|
1860
1871
|
}));
|
1861
1872
|
|
@@ -2098,6 +2109,11 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
2098
2109
|
};
|
2099
2110
|
}
|
2100
2111
|
|
2112
|
+
/**
|
2113
|
+
@module ember
|
2114
|
+
@private
|
2115
|
+
*/
|
2116
|
+
|
2101
2117
|
var PROPERTY_DID_CHANGE = emberUtils.symbol('PROPERTY_DID_CHANGE');
|
2102
2118
|
|
2103
2119
|
var beforeObserverSet = new ObserverSet();
|
@@ -2406,7 +2422,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
2406
2422
|
}
|
2407
2423
|
|
2408
2424
|
/**
|
2409
|
-
@module ember
|
2425
|
+
@module @ember/object
|
2410
2426
|
*/
|
2411
2427
|
|
2412
2428
|
// ..........................................................
|
@@ -2450,7 +2466,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
2450
2466
|
if (!m.isInitialized(this)) {
|
2451
2467
|
m.writeValues(name, value);
|
2452
2468
|
} else {
|
2453
|
-
true && !false && emberDebug.assert('You must use
|
2469
|
+
true && !false && emberDebug.assert('You must use set() to set the `' + name + '` property (of ' + this + ') to `' + value + '`.', false);
|
2454
2470
|
}
|
2455
2471
|
}
|
2456
2472
|
|
@@ -2490,7 +2506,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
2490
2506
|
/**
|
2491
2507
|
NOTE: This is a low-level method used by other parts of the API. You almost
|
2492
2508
|
never want to call this method directly. Instead you should use
|
2493
|
-
`
|
2509
|
+
`mixin()` to define new properties.
|
2494
2510
|
|
2495
2511
|
Defines a property on an object. This method works much like the ES5
|
2496
2512
|
`Object.defineProperty()` method except that it can also accept computed
|
@@ -2504,8 +2520,10 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
2504
2520
|
## Examples
|
2505
2521
|
|
2506
2522
|
```javascript
|
2523
|
+
import { defineProperty, computed } from '@ember/object';
|
2524
|
+
|
2507
2525
|
// ES5 compatible mode
|
2508
|
-
|
2526
|
+
defineProperty(contact, 'firstName', {
|
2509
2527
|
writable: true,
|
2510
2528
|
configurable: false,
|
2511
2529
|
enumerable: true,
|
@@ -2513,17 +2531,17 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
2513
2531
|
});
|
2514
2532
|
|
2515
2533
|
// define a simple property
|
2516
|
-
|
2534
|
+
defineProperty(contact, 'lastName', undefined, 'Jolley');
|
2517
2535
|
|
2518
2536
|
// define a computed property
|
2519
|
-
|
2537
|
+
defineProperty(contact, 'fullName', computed('firstName', 'lastName', function() {
|
2520
2538
|
return this.firstName+' '+this.lastName;
|
2521
2539
|
}));
|
2522
2540
|
```
|
2523
2541
|
|
2524
2542
|
@private
|
2525
2543
|
@method defineProperty
|
2526
|
-
@for
|
2544
|
+
@for @ember/object
|
2527
2545
|
@param {Object} obj the object to define this property on. This may be a prototype.
|
2528
2546
|
@param {String} keyName the name of the property
|
2529
2547
|
@param {Descriptor} [desc] an instance of `Descriptor` (typically a
|
@@ -3191,7 +3209,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
3191
3209
|
}
|
3192
3210
|
|
3193
3211
|
/**
|
3194
|
-
@module ember
|
3212
|
+
@module ember
|
3195
3213
|
*/
|
3196
3214
|
|
3197
3215
|
var UNDEFINED = emberUtils.symbol('undefined');
|
@@ -3905,7 +3923,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
3905
3923
|
}
|
3906
3924
|
|
3907
3925
|
/**
|
3908
|
-
@module ember
|
3926
|
+
@module @ember/object
|
3909
3927
|
*/
|
3910
3928
|
|
3911
3929
|
var ALLOWABLE_TYPES = {
|
@@ -3944,7 +3962,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
3944
3962
|
an error.
|
3945
3963
|
|
3946
3964
|
@method get
|
3947
|
-
@for
|
3965
|
+
@for @ember/object
|
3966
|
+
@static
|
3948
3967
|
@param {Object} obj The object to retrieve from.
|
3949
3968
|
@param {String} keyName The property key to retrieve
|
3950
3969
|
@return {Object} the property value or `null`.
|
@@ -4003,7 +4022,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
4003
4022
|
```
|
4004
4023
|
|
4005
4024
|
@method getWithDefault
|
4006
|
-
@for
|
4025
|
+
@for @ember/object
|
4026
|
+
@static
|
4007
4027
|
@param {Object} obj The object to retrieve from.
|
4008
4028
|
@param {String} keyName The name of the property to retrieve
|
4009
4029
|
@param {Object} defaultValue The value to return if the property value is undefined
|
@@ -4019,6 +4039,9 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
4019
4039
|
return value;
|
4020
4040
|
}
|
4021
4041
|
|
4042
|
+
/**
|
4043
|
+
@module @ember/object
|
4044
|
+
*/
|
4022
4045
|
/**
|
4023
4046
|
Sets the value of a property on an object, respecting computed properties
|
4024
4047
|
and notifying observers and other listeners of the change. If the
|
@@ -4030,7 +4053,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
4030
4053
|
```
|
4031
4054
|
|
4032
4055
|
@method set
|
4033
|
-
@
|
4056
|
+
@static
|
4057
|
+
@for @ember/object
|
4034
4058
|
@param {Object} obj The object to modify.
|
4035
4059
|
@param {String} keyName The property key to set
|
4036
4060
|
@param {Object} value The value to set
|
@@ -4119,7 +4143,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
4119
4143
|
an object has been destroyed.
|
4120
4144
|
|
4121
4145
|
@method trySet
|
4122
|
-
@
|
4146
|
+
@static
|
4147
|
+
@for @ember/object
|
4123
4148
|
@param {Object} root The object to modify.
|
4124
4149
|
@param {String} path The property path to set
|
4125
4150
|
@param {Object} value The value to set
|
@@ -4130,8 +4155,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
4130
4155
|
}
|
4131
4156
|
|
4132
4157
|
/**
|
4133
|
-
@module ember
|
4134
|
-
@submodule ember-metal
|
4158
|
+
@module @ember/object
|
4135
4159
|
*/
|
4136
4160
|
|
4137
4161
|
var END_WITH_EACH_REGEX = /\.@each$/;
|
@@ -4145,19 +4169,22 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
4145
4169
|
Example
|
4146
4170
|
|
4147
4171
|
```js
|
4172
|
+
import { expandProperties } from '@ember/object/computed';
|
4173
|
+
|
4148
4174
|
function echo(arg){ console.log(arg); }
|
4149
4175
|
|
4150
|
-
|
4151
|
-
|
4152
|
-
|
4153
|
-
|
4154
|
-
|
4155
|
-
|
4156
|
-
|
4176
|
+
expandProperties('foo.bar', echo); //=> 'foo.bar'
|
4177
|
+
expandProperties('{foo,bar}', echo); //=> 'foo', 'bar'
|
4178
|
+
expandProperties('foo.{bar,baz}', echo); //=> 'foo.bar', 'foo.baz'
|
4179
|
+
expandProperties('{foo,bar}.baz', echo); //=> 'foo.baz', 'bar.baz'
|
4180
|
+
expandProperties('foo.{bar,baz}.[]', echo) //=> 'foo.bar.[]', 'foo.baz.[]'
|
4181
|
+
expandProperties('{foo,bar}.{spam,eggs}', echo) //=> 'foo.spam', 'foo.eggs', 'bar.spam', 'bar.eggs'
|
4182
|
+
expandProperties('{foo}.bar.{baz}') //=> 'foo.bar.baz'
|
4157
4183
|
```
|
4158
4184
|
|
4159
4185
|
@method expandProperties
|
4160
|
-
@
|
4186
|
+
@static
|
4187
|
+
@for @ember/object
|
4161
4188
|
@public
|
4162
4189
|
@param {String} pattern The property pattern to expand.
|
4163
4190
|
@param {Function} callback The callback to invoke. It is invoked once per
|
@@ -4199,7 +4226,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
4199
4226
|
}
|
4200
4227
|
|
4201
4228
|
/**
|
4202
|
-
@module ember
|
4229
|
+
@module ember
|
4203
4230
|
*/
|
4204
4231
|
/**
|
4205
4232
|
Starts watching a property on an object. Whenever the property changes,
|
@@ -4239,11 +4266,6 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
4239
4266
|
}
|
4240
4267
|
}
|
4241
4268
|
|
4242
|
-
/**
|
4243
|
-
@module ember
|
4244
|
-
@submodule ember-metal
|
4245
|
-
*/
|
4246
|
-
|
4247
4269
|
// ..........................................................
|
4248
4270
|
// DEPENDENT KEYS
|
4249
4271
|
//
|
@@ -4283,8 +4305,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
4283
4305
|
}
|
4284
4306
|
|
4285
4307
|
/**
|
4286
|
-
@module ember
|
4287
|
-
@submodule ember-metal
|
4308
|
+
@module @ember/object
|
4288
4309
|
*/
|
4289
4310
|
|
4290
4311
|
var DEEP_EACH_REGEX = /\.@each\.[^.]+\./;
|
@@ -4298,23 +4319,25 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
4298
4319
|
result to be recomputed if the dependencies are modified.
|
4299
4320
|
|
4300
4321
|
In the following example we declare a computed property - `fullName` - by calling
|
4301
|
-
|
4322
|
+
`computed` with property dependencies (`firstName` and `lastName`) as leading arguments and getter accessor function. The `fullName` getter function
|
4302
4323
|
will be called once (regardless of how many times it is accessed) as long
|
4303
4324
|
as its dependencies have not changed. Once `firstName` or `lastName` are updated
|
4304
4325
|
any future calls (or anything bound) to `fullName` will incorporate the new
|
4305
4326
|
values.
|
4306
4327
|
|
4307
4328
|
```javascript
|
4308
|
-
|
4329
|
+
import EmberObject, { computed } from '@ember/object';
|
4330
|
+
|
4331
|
+
let Person = EmberObject.extend({
|
4309
4332
|
// these will be supplied by `create`
|
4310
4333
|
firstName: null,
|
4311
4334
|
lastName: null,
|
4312
4335
|
|
4313
|
-
fullName:
|
4336
|
+
fullName: computed('firstName', 'lastName', function() {
|
4314
4337
|
let firstName = this.get('firstName'),
|
4315
4338
|
lastName = this.get('lastName');
|
4316
4339
|
|
4317
|
-
return firstName
|
4340
|
+
return `${firstName} ${lastName}`;
|
4318
4341
|
})
|
4319
4342
|
});
|
4320
4343
|
|
@@ -4331,12 +4354,14 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
4331
4354
|
value you want to set it to as arguments.
|
4332
4355
|
|
4333
4356
|
```javascript
|
4334
|
-
|
4357
|
+
import EmberObject, { computed } from '@ember/object';
|
4358
|
+
|
4359
|
+
let Person = EmberObject.extend({
|
4335
4360
|
// these will be supplied by `create`
|
4336
4361
|
firstName: null,
|
4337
4362
|
lastName: null,
|
4338
4363
|
|
4339
|
-
fullName:
|
4364
|
+
fullName: computed('firstName', 'lastName', {
|
4340
4365
|
get(key) {
|
4341
4366
|
let firstName = this.get('firstName'),
|
4342
4367
|
lastName = this.get('lastName');
|
@@ -4366,12 +4391,14 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
4366
4391
|
You can also mark computed property as `.readOnly()` and block all attempts to set it.
|
4367
4392
|
|
4368
4393
|
```javascript
|
4369
|
-
|
4394
|
+
import EmberObject, { computed } from '@ember/object';
|
4395
|
+
|
4396
|
+
let Person = EmberObject.extend({
|
4370
4397
|
// these will be supplied by `create`
|
4371
4398
|
firstName: null,
|
4372
4399
|
lastName: null,
|
4373
4400
|
|
4374
|
-
fullName:
|
4401
|
+
fullName: computed('firstName', 'lastName', {
|
4375
4402
|
get(key) {
|
4376
4403
|
let firstName = this.get('firstName');
|
4377
4404
|
let lastName = this.get('lastName');
|
@@ -4390,7 +4417,6 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
4390
4417
|
- [New computed syntax explained in "Ember 1.12 released" ](https://emberjs.com/blog/2015/05/13/ember-1-12-released.html#toc_new-computed-syntax)
|
4391
4418
|
|
4392
4419
|
@class ComputedProperty
|
4393
|
-
@namespace Ember
|
4394
4420
|
@public
|
4395
4421
|
*/
|
4396
4422
|
function ComputedProperty(config, opts) {
|
@@ -4399,10 +4425,10 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
4399
4425
|
if (hasGetterOnly) {
|
4400
4426
|
this._getter = config;
|
4401
4427
|
} else {
|
4402
|
-
true && !(typeof config === 'object' && !Array.isArray(config)) && emberDebug.assert('
|
4428
|
+
true && !(typeof config === 'object' && !Array.isArray(config)) && emberDebug.assert('computed expects a function or an object as last argument.', typeof config === 'object' && !Array.isArray(config));
|
4403
4429
|
true && !Object.keys(config).every(function (key) {
|
4404
4430
|
return key === 'get' || key === 'set';
|
4405
|
-
}) && emberDebug.assert('Config object passed to
|
4431
|
+
}) && emberDebug.assert('Config object passed to computed can only contain `get` or `set` keys.', Object.keys(config).every(function (key) {
|
4406
4432
|
return key === 'get' || key === 'set';
|
4407
4433
|
}));
|
4408
4434
|
|
@@ -4435,15 +4461,19 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
4435
4461
|
invalidation and notification when cached value is invalidated.
|
4436
4462
|
|
4437
4463
|
```javascript
|
4438
|
-
|
4439
|
-
|
4464
|
+
import EmberObject, { computed } from '@ember/object';
|
4465
|
+
|
4466
|
+
let outsideService = EmberObject.extend({
|
4467
|
+
value: computed(function() {
|
4440
4468
|
return OutsideService.getValue();
|
4441
4469
|
}).volatile()
|
4442
4470
|
}).create();
|
4443
4471
|
```
|
4444
4472
|
|
4445
4473
|
@method volatile
|
4446
|
-
@
|
4474
|
+
@static
|
4475
|
+
@for @ember/object/computed
|
4476
|
+
@return {ComputedProperty} this
|
4447
4477
|
@chainable
|
4448
4478
|
@public
|
4449
4479
|
*/
|
@@ -4457,8 +4487,10 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
4457
4487
|
mode the computed property will throw an error when set.
|
4458
4488
|
|
4459
4489
|
```javascript
|
4460
|
-
|
4461
|
-
|
4490
|
+
import EmberObject, { computed } from '@ember/object';
|
4491
|
+
|
4492
|
+
let Person = EmberObject.extend({
|
4493
|
+
guid: computed(function() {
|
4462
4494
|
return 'guid-guid-guid';
|
4463
4495
|
}).readOnly()
|
4464
4496
|
});
|
@@ -4469,7 +4501,9 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
4469
4501
|
```
|
4470
4502
|
|
4471
4503
|
@method readOnly
|
4472
|
-
@
|
4504
|
+
@static
|
4505
|
+
@for @ember/object/computed
|
4506
|
+
@return {ComputedProperty} this
|
4473
4507
|
@chainable
|
4474
4508
|
@public
|
4475
4509
|
*/
|
@@ -4485,13 +4519,15 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
4485
4519
|
arguments containing key paths that this computed property depends on.
|
4486
4520
|
|
4487
4521
|
```javascript
|
4488
|
-
|
4489
|
-
|
4522
|
+
import EmberObject, { computed } from '@ember/object';
|
4523
|
+
|
4524
|
+
let President = EmberObject.extend({
|
4525
|
+
fullName: computed('firstName', 'lastName', function() {
|
4490
4526
|
return this.get('firstName') + ' ' + this.get('lastName');
|
4491
4527
|
|
4492
4528
|
// Tell Ember that this computed property depends on firstName
|
4493
4529
|
// and lastName
|
4494
|
-
})
|
4530
|
+
})
|
4495
4531
|
});
|
4496
4532
|
|
4497
4533
|
let president = President.create({
|
@@ -4503,8 +4539,10 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
4503
4539
|
```
|
4504
4540
|
|
4505
4541
|
@method property
|
4542
|
+
@static
|
4543
|
+
@for @ember/object/computed
|
4506
4544
|
@param {String} path* zero or more property paths
|
4507
|
-
@return {
|
4545
|
+
@return {ComputedProperty} this
|
4508
4546
|
@chainable
|
4509
4547
|
@public
|
4510
4548
|
*/
|
@@ -4549,6 +4587,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
4549
4587
|
via the `metaForProperty()` function.
|
4550
4588
|
|
4551
4589
|
@method meta
|
4590
|
+
@static
|
4591
|
+
@for @ember/object/computed
|
4552
4592
|
@param {Object} meta
|
4553
4593
|
@chainable
|
4554
4594
|
@public
|
@@ -4705,13 +4745,15 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
4705
4745
|
/**
|
4706
4746
|
This helper returns a new property descriptor that wraps the passed
|
4707
4747
|
computed property function. You can use this helper to define properties
|
4708
|
-
with mixins or via `
|
4748
|
+
with mixins or via `defineProperty()`.
|
4709
4749
|
|
4710
4750
|
If you pass a function as an argument, it will be used as a getter. A computed
|
4711
4751
|
property defined in this way might look like this:
|
4712
4752
|
|
4713
4753
|
```js
|
4714
|
-
|
4754
|
+
import EmberObject, { computed } from '@ember/object';
|
4755
|
+
|
4756
|
+
let Person = EmberObject.extend({
|
4715
4757
|
init() {
|
4716
4758
|
this._super(...arguments);
|
4717
4759
|
|
@@ -4719,7 +4761,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
4719
4761
|
this.lastName = 'Jones';
|
4720
4762
|
},
|
4721
4763
|
|
4722
|
-
fullName:
|
4764
|
+
fullName: computed('firstName', 'lastName', function() {
|
4723
4765
|
return `${this.get('firstName')} ${this.get('lastName')}`;
|
4724
4766
|
})
|
4725
4767
|
});
|
@@ -4736,7 +4778,9 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
4736
4778
|
argument to provide both a getter and setter:
|
4737
4779
|
|
4738
4780
|
```js
|
4739
|
-
|
4781
|
+
import EmberObject, { computed } from '@ember/object';
|
4782
|
+
|
4783
|
+
let Person = EmberObject.extend({
|
4740
4784
|
init() {
|
4741
4785
|
this._super(...arguments);
|
4742
4786
|
|
@@ -4744,7 +4788,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
4744
4788
|
this.lastName = 'Jones';
|
4745
4789
|
},
|
4746
4790
|
|
4747
|
-
fullName:
|
4791
|
+
fullName: computed('firstName', 'lastName', {
|
4748
4792
|
get(key) {
|
4749
4793
|
return `${this.get('firstName')} ${this.get('lastName')}`;
|
4750
4794
|
},
|
@@ -4778,13 +4822,12 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
4778
4822
|
}.property('firstName', 'lastName')
|
4779
4823
|
```
|
4780
4824
|
|
4781
|
-
@
|
4782
|
-
@
|
4783
|
-
@constructor
|
4825
|
+
@method computed
|
4826
|
+
@for @ember/object
|
4784
4827
|
@static
|
4785
4828
|
@param {String} [dependentKeys*] Optional dependent keys that trigger this computed property.
|
4786
4829
|
@param {Function} func The computed property function.
|
4787
|
-
@return {
|
4830
|
+
@return {ComputedProperty} property descriptor instance
|
4788
4831
|
@public
|
4789
4832
|
*/
|
4790
4833
|
function computed() {
|
@@ -4810,7 +4853,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
4810
4853
|
it to be created.
|
4811
4854
|
|
4812
4855
|
@method cacheFor
|
4813
|
-
@
|
4856
|
+
@static
|
4857
|
+
@for @ember/object/internals
|
4814
4858
|
@param {Object} obj the object whose property you want to check
|
4815
4859
|
@param {String} key the name of the property whose cached value you want
|
4816
4860
|
to return
|
@@ -4932,18 +4976,24 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
4932
4976
|
AliasedProperty.prototype._meta = undefined;
|
4933
4977
|
AliasedProperty.prototype.meta = ComputedProperty.prototype.meta;
|
4934
4978
|
|
4979
|
+
/**
|
4980
|
+
@module @ember/polyfills
|
4981
|
+
*/
|
4935
4982
|
/**
|
4936
4983
|
Merge the contents of two objects together into the first object.
|
4937
4984
|
|
4938
4985
|
```javascript
|
4939
|
-
|
4986
|
+
import { merge } from '@ember/polyfills';
|
4987
|
+
|
4988
|
+
merge({ first: 'Tom' }, { last: 'Dale' }); // { first: 'Tom', last: 'Dale' }
|
4940
4989
|
var a = { first: 'Yehuda' };
|
4941
4990
|
var b = { last: 'Katz' };
|
4942
|
-
|
4991
|
+
merge(a, b); // a == { first: 'Yehuda', last: 'Katz' }, b == { last: 'Katz' }
|
4943
4992
|
```
|
4944
4993
|
|
4945
4994
|
@method merge
|
4946
|
-
@
|
4995
|
+
@static
|
4996
|
+
@for @ember/polyfills
|
4947
4997
|
@param {Object} original The object to merge into
|
4948
4998
|
@param {Object} updates The object to copy properties from
|
4949
4999
|
@return {Object}
|
@@ -4967,7 +5017,6 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
4967
5017
|
|
4968
5018
|
/**
|
4969
5019
|
@module ember
|
4970
|
-
@submodule ember-metal
|
4971
5020
|
*/
|
4972
5021
|
|
4973
5022
|
/**
|
@@ -5004,15 +5053,22 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
5004
5053
|
/* eslint no-console:off */
|
5005
5054
|
/* global console */
|
5006
5055
|
|
5056
|
+
/**
|
5057
|
+
@module @ember/instrumentation
|
5058
|
+
@private
|
5059
|
+
*/
|
5060
|
+
|
5007
5061
|
/**
|
5008
5062
|
The purpose of the Ember Instrumentation module is
|
5009
5063
|
to provide efficient, general-purpose instrumentation
|
5010
5064
|
for Ember.
|
5011
5065
|
|
5012
|
-
Subscribe to a listener by using `
|
5066
|
+
Subscribe to a listener by using `subscribe`:
|
5013
5067
|
|
5014
5068
|
```javascript
|
5015
|
-
|
5069
|
+
import { subscribe } from '@ember/instrumentation';
|
5070
|
+
|
5071
|
+
subscribe("render", {
|
5016
5072
|
before(name, timestamp, payload) {
|
5017
5073
|
|
5018
5074
|
},
|
@@ -5027,15 +5083,17 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
5027
5083
|
value will be passed as a fourth parameter to the `after`
|
5028
5084
|
callback.
|
5029
5085
|
|
5030
|
-
Instrument a block of code by using `
|
5086
|
+
Instrument a block of code by using `instrument`:
|
5031
5087
|
|
5032
5088
|
```javascript
|
5033
|
-
|
5089
|
+
import { instrument } from '@ember/instrumentation';
|
5090
|
+
|
5091
|
+
instrument("render.handlebars", payload, function() {
|
5034
5092
|
// rendering logic
|
5035
5093
|
}, binding);
|
5036
5094
|
```
|
5037
5095
|
|
5038
|
-
Event names passed to `
|
5096
|
+
Event names passed to `instrument` are namespaced
|
5039
5097
|
by periods, from more general to more specific. Subscribers
|
5040
5098
|
can listen for events by whatever level of granularity they
|
5041
5099
|
are interested in.
|
@@ -5047,7 +5105,6 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
5047
5105
|
even `render.handlebars.layout`.
|
5048
5106
|
|
5049
5107
|
@class Instrumentation
|
5050
|
-
@namespace Ember
|
5051
5108
|
@static
|
5052
5109
|
@private
|
5053
5110
|
*/
|
@@ -5082,8 +5139,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
5082
5139
|
Notifies event's subscribers, calls `before` and `after` hooks.
|
5083
5140
|
|
5084
5141
|
@method instrument
|
5085
|
-
@
|
5086
|
-
|
5142
|
+
@for @ember/instrumentation
|
5143
|
+
@static
|
5087
5144
|
@param {String} [name] Namespaced event name.
|
5088
5145
|
@param {Object} _payload
|
5089
5146
|
@param {Function} callback Function that you're instrumenting.
|
@@ -5189,7 +5246,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
5189
5246
|
Subscribes to a particular event or instrumented block of code.
|
5190
5247
|
|
5191
5248
|
@method subscribe
|
5192
|
-
@
|
5249
|
+
@for @ember/instrumentation
|
5250
|
+
@static
|
5193
5251
|
|
5194
5252
|
@param {String} [pattern] Namespaced event name.
|
5195
5253
|
@param {Object} [object] Before and After hooks.
|
@@ -5230,7 +5288,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
5230
5288
|
Unsubscribes from a particular event or instrumented block of code.
|
5231
5289
|
|
5232
5290
|
@method unsubscribe
|
5233
|
-
@
|
5291
|
+
@for @ember/instrumentation
|
5292
|
+
@static
|
5234
5293
|
|
5235
5294
|
@param {Object} [subscriber]
|
5236
5295
|
@private
|
@@ -5249,10 +5308,11 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
5249
5308
|
}
|
5250
5309
|
|
5251
5310
|
/**
|
5252
|
-
Resets `
|
5311
|
+
Resets `Instrumentation` by flushing list of subscribers.
|
5253
5312
|
|
5254
5313
|
@method reset
|
5255
|
-
@
|
5314
|
+
@for @ember/instrumentation
|
5315
|
+
@static
|
5256
5316
|
@private
|
5257
5317
|
*/
|
5258
5318
|
function reset() {
|
@@ -5317,6 +5377,9 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
5317
5377
|
}
|
5318
5378
|
}
|
5319
5379
|
|
5380
|
+
/**
|
5381
|
+
@module ember
|
5382
|
+
*/
|
5320
5383
|
var id = 0;
|
5321
5384
|
|
5322
5385
|
// Returns whether Type(value) is Object according to the terminology in the spec
|
@@ -5454,22 +5517,26 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
5454
5517
|
|
5455
5518
|
var weak_map = emberUtils.HAS_NATIVE_WEAKMAP ? WeakMap : WeakMapPolyfill;
|
5456
5519
|
|
5520
|
+
/**
|
5521
|
+
@module @ember/utils
|
5522
|
+
*/
|
5457
5523
|
/**
|
5458
5524
|
Returns true if the passed value is null or undefined. This avoids errors
|
5459
5525
|
from JSLint complaining about use of ==, which can be technically
|
5460
5526
|
confusing.
|
5461
5527
|
|
5462
5528
|
```javascript
|
5463
|
-
|
5464
|
-
|
5465
|
-
|
5466
|
-
|
5467
|
-
|
5468
|
-
|
5529
|
+
isNone(); // true
|
5530
|
+
isNone(null); // true
|
5531
|
+
isNone(undefined); // true
|
5532
|
+
isNone(''); // false
|
5533
|
+
isNone([]); // false
|
5534
|
+
isNone(function() {}); // false
|
5469
5535
|
```
|
5470
5536
|
|
5471
5537
|
@method isNone
|
5472
|
-
@
|
5538
|
+
@static
|
5539
|
+
@for @ember/utils
|
5473
5540
|
@param {Object} obj Value to test
|
5474
5541
|
@return {Boolean}
|
5475
5542
|
@public
|
@@ -5478,28 +5545,32 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
5478
5545
|
return obj === null || obj === undefined;
|
5479
5546
|
}
|
5480
5547
|
|
5548
|
+
/**
|
5549
|
+
@module @ember/utils
|
5550
|
+
*/
|
5481
5551
|
/**
|
5482
5552
|
Verifies that a value is `null` or `undefined`, an empty string, or an empty
|
5483
5553
|
array.
|
5484
5554
|
|
5485
|
-
Constrains the rules on `
|
5555
|
+
Constrains the rules on `isNone` by returning true for empty strings and
|
5486
5556
|
empty arrays.
|
5487
5557
|
|
5488
5558
|
```javascript
|
5489
|
-
|
5490
|
-
|
5491
|
-
|
5492
|
-
|
5493
|
-
|
5494
|
-
|
5495
|
-
|
5496
|
-
|
5497
|
-
|
5498
|
-
|
5559
|
+
isEmpty(); // true
|
5560
|
+
isEmpty(null); // true
|
5561
|
+
isEmpty(undefined); // true
|
5562
|
+
isEmpty(''); // true
|
5563
|
+
isEmpty([]); // true
|
5564
|
+
isEmpty({}); // false
|
5565
|
+
isEmpty('Adam Hawkins'); // false
|
5566
|
+
isEmpty([0,1,2]); // false
|
5567
|
+
isEmpty('\n\t'); // false
|
5568
|
+
isEmpty(' '); // false
|
5499
5569
|
```
|
5500
5570
|
|
5501
5571
|
@method isEmpty
|
5502
|
-
@
|
5572
|
+
@static
|
5573
|
+
@for @ember/utils
|
5503
5574
|
@param {Object} obj Value to test
|
5504
5575
|
@return {Boolean}
|
5505
5576
|
@public
|
@@ -5537,25 +5608,31 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
5537
5608
|
return false;
|
5538
5609
|
}
|
5539
5610
|
|
5611
|
+
/**
|
5612
|
+
@module @ember/utils
|
5613
|
+
*/
|
5540
5614
|
/**
|
5541
5615
|
A value is blank if it is empty or a whitespace string.
|
5542
5616
|
|
5543
5617
|
```javascript
|
5544
|
-
|
5545
|
-
|
5546
|
-
|
5547
|
-
|
5548
|
-
|
5549
|
-
|
5550
|
-
|
5551
|
-
|
5552
|
-
|
5553
|
-
|
5554
|
-
|
5618
|
+
import { isBlank } from '@ember/utils';
|
5619
|
+
|
5620
|
+
isBlank(); // true
|
5621
|
+
isBlank(null); // true
|
5622
|
+
isBlank(undefined); // true
|
5623
|
+
isBlank(''); // true
|
5624
|
+
isBlank([]); // true
|
5625
|
+
isBlank('\n\t'); // true
|
5626
|
+
isBlank(' '); // true
|
5627
|
+
isBlank({}); // false
|
5628
|
+
isBlank('\n\t Hello'); // false
|
5629
|
+
isBlank('Hello world'); // false
|
5630
|
+
isBlank([1,2,3]); // false
|
5555
5631
|
```
|
5556
5632
|
|
5557
5633
|
@method isBlank
|
5558
|
-
@
|
5634
|
+
@static
|
5635
|
+
@for @ember/utils
|
5559
5636
|
@param {Object} obj Value to test
|
5560
5637
|
@return {Boolean}
|
5561
5638
|
@since 1.5.0
|
@@ -5565,31 +5642,35 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
5565
5642
|
return isEmpty(obj) || typeof obj === 'string' && /\S/.test(obj) === false;
|
5566
5643
|
}
|
5567
5644
|
|
5645
|
+
/**
|
5646
|
+
@module @ember/utils
|
5647
|
+
*/
|
5568
5648
|
/**
|
5569
5649
|
A value is present if it not `isBlank`.
|
5570
5650
|
|
5571
5651
|
```javascript
|
5572
|
-
|
5573
|
-
|
5574
|
-
|
5575
|
-
|
5576
|
-
|
5577
|
-
|
5578
|
-
|
5579
|
-
|
5580
|
-
|
5581
|
-
|
5582
|
-
|
5583
|
-
|
5584
|
-
|
5585
|
-
|
5586
|
-
|
5587
|
-
|
5588
|
-
|
5652
|
+
isPresent(); // false
|
5653
|
+
isPresent(null); // false
|
5654
|
+
isPresent(undefined); // false
|
5655
|
+
isPresent(''); // false
|
5656
|
+
isPresent(' '); // false
|
5657
|
+
isPresent('\n\t'); // false
|
5658
|
+
isPresent([]); // false
|
5659
|
+
isPresent({ length: 0 }) // false
|
5660
|
+
isPresent(false); // true
|
5661
|
+
isPresent(true); // true
|
5662
|
+
isPresent('string'); // true
|
5663
|
+
isPresent(0); // true
|
5664
|
+
isPresent(function() {}) // true
|
5665
|
+
isPresent({}); // true
|
5666
|
+
isPresent(false); // true
|
5667
|
+
isPresent('\n\t Hello'); // true
|
5668
|
+
isPresent([1,2,3]); // true
|
5589
5669
|
```
|
5590
5670
|
|
5591
5671
|
@method isPresent
|
5592
|
-
@
|
5672
|
+
@static
|
5673
|
+
@for @ember/utils
|
5593
5674
|
@param {Object} obj Value to test
|
5594
5675
|
@return {Boolean}
|
5595
5676
|
@since 1.8.0
|
@@ -5620,6 +5701,9 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
5620
5701
|
onErrorMethod: 'onerror'
|
5621
5702
|
});
|
5622
5703
|
|
5704
|
+
/**
|
5705
|
+
@module @ember/runloop
|
5706
|
+
*/
|
5623
5707
|
// ..........................................................
|
5624
5708
|
// run - this is ideally the only public API the dev sees
|
5625
5709
|
//
|
@@ -5640,8 +5724,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
5640
5724
|
});
|
5641
5725
|
```
|
5642
5726
|
|
5643
|
-
@class
|
5644
|
-
@namespace Ember
|
5727
|
+
@class @ember/runloop
|
5645
5728
|
@static
|
5646
5729
|
@constructor
|
5647
5730
|
@param {Object} [target] target of method to call
|
@@ -5684,7 +5767,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
5684
5767
|
```
|
5685
5768
|
|
5686
5769
|
@method join
|
5687
|
-
@
|
5770
|
+
@static
|
5771
|
+
@for @ember/runloop
|
5688
5772
|
@param {Object} [target] target of method to call
|
5689
5773
|
@param {Function|String} method Method to invoke.
|
5690
5774
|
May be a function or a string. If you pass a string
|
@@ -5748,7 +5832,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
5748
5832
|
method be safely handled and executed by the Ember run loop.
|
5749
5833
|
|
5750
5834
|
@method bind
|
5751
|
-
@
|
5835
|
+
@static
|
5836
|
+
@for @ember/runloop
|
5752
5837
|
@param {Object} [target] target of method to call
|
5753
5838
|
@param {Function|String} method Method to invoke.
|
5754
5839
|
May be a function or a string. If you pass a string
|
@@ -5788,6 +5873,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
5788
5873
|
```
|
5789
5874
|
|
5790
5875
|
@method begin
|
5876
|
+
@static
|
5877
|
+
@for @ember/runloop
|
5791
5878
|
@return {void}
|
5792
5879
|
@public
|
5793
5880
|
*/
|
@@ -5807,6 +5894,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
5807
5894
|
```
|
5808
5895
|
|
5809
5896
|
@method end
|
5897
|
+
@static
|
5898
|
+
@for @ember/runloop
|
5810
5899
|
@return {void}
|
5811
5900
|
@public
|
5812
5901
|
*/
|
@@ -5854,6 +5943,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
5854
5943
|
```
|
5855
5944
|
|
5856
5945
|
@method schedule
|
5946
|
+
@static
|
5947
|
+
@for @ember/runloop
|
5857
5948
|
@param {String} queue The name of the queue to schedule against.
|
5858
5949
|
Default queues are 'sync' and 'actions'
|
5859
5950
|
@param {Object} [target] target object to use as the context when invoking a method.
|
@@ -5894,6 +5985,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
5894
5985
|
```
|
5895
5986
|
|
5896
5987
|
@method sync
|
5988
|
+
@static
|
5989
|
+
@for @ember/runloop
|
5897
5990
|
@return {void}
|
5898
5991
|
@private
|
5899
5992
|
*/
|
@@ -5920,6 +6013,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
5920
6013
|
```
|
5921
6014
|
|
5922
6015
|
@method later
|
6016
|
+
@static
|
6017
|
+
@for @ember/runloop
|
5923
6018
|
@param {Object} [target] target of method to invoke
|
5924
6019
|
@param {Function|String} method The method to invoke.
|
5925
6020
|
If you pass a string it will be resolved on the
|
@@ -5938,6 +6033,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
5938
6033
|
to calling `scheduleOnce` with the "actions" queue.
|
5939
6034
|
|
5940
6035
|
@method once
|
6036
|
+
@static
|
6037
|
+
@for @ember/runloop
|
5941
6038
|
@param {Object} [target] The target of the method to invoke.
|
5942
6039
|
@param {Function|String} method The method to invoke.
|
5943
6040
|
If you pass a string it will be resolved on the
|
@@ -6014,6 +6111,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
6014
6111
|
Available queues, and their order, can be found at `run.queues`
|
6015
6112
|
|
6016
6113
|
@method scheduleOnce
|
6114
|
+
@static
|
6115
|
+
@for @ember/runloop
|
6017
6116
|
@param {String} [queue] The name of the queue to schedule against. Default queues are 'sync' and 'actions'.
|
6018
6117
|
@param {Object} [target] The target of the method to invoke.
|
6019
6118
|
@param {Function|String} method The method to invoke.
|
@@ -6086,6 +6185,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
6086
6185
|
outside of the current run loop, i.e. with `run.next`.
|
6087
6186
|
|
6088
6187
|
@method next
|
6188
|
+
@static
|
6189
|
+
@for @ember/runloop
|
6089
6190
|
@param {Object} [target] target of method to invoke
|
6090
6191
|
@param {Function|String} method The method to invoke.
|
6091
6192
|
If you pass a string it will be resolved on the
|
@@ -6154,6 +6255,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
6154
6255
|
```
|
6155
6256
|
|
6156
6257
|
@method cancel
|
6258
|
+
@static
|
6259
|
+
@for @ember/runloop
|
6157
6260
|
@param {Object} timer Timer object to cancel
|
6158
6261
|
@return {Boolean} true if canceled or false/undefined if it wasn't found
|
6159
6262
|
@public
|
@@ -6220,6 +6323,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
6220
6323
|
```
|
6221
6324
|
|
6222
6325
|
@method debounce
|
6326
|
+
@static
|
6327
|
+
@for @ember/runloop
|
6223
6328
|
@param {Object} [target] target of method to invoke
|
6224
6329
|
@param {Function|String} method The method to invoke.
|
6225
6330
|
May be a function or a string. If you pass a string
|
@@ -6263,6 +6368,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
6263
6368
|
```
|
6264
6369
|
|
6265
6370
|
@method throttle
|
6371
|
+
@static
|
6372
|
+
@for @ember/runloop
|
6266
6373
|
@param {Object} [target] target of method to invoke
|
6267
6374
|
@param {Function|String} method The method to invoke.
|
6268
6375
|
May be a function or a string. If you pass a string
|
@@ -6294,6 +6401,9 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
6294
6401
|
}
|
6295
6402
|
};
|
6296
6403
|
|
6404
|
+
/**
|
6405
|
+
@module ember
|
6406
|
+
*/
|
6297
6407
|
/**
|
6298
6408
|
Helper class that allows you to register your library with Ember.
|
6299
6409
|
|
@@ -6367,7 +6477,6 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
6367
6477
|
|
6368
6478
|
/**
|
6369
6479
|
@module ember
|
6370
|
-
@submodule ember-metal
|
6371
6480
|
*/
|
6372
6481
|
|
6373
6482
|
/*
|
@@ -6375,7 +6484,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
6375
6484
|
which are often used as dictionaries, may only have Strings as keys.
|
6376
6485
|
|
6377
6486
|
Because Ember has a way to get a unique identifier for every object
|
6378
|
-
via `
|
6487
|
+
via `guidFor`, we can implement a performant Map with arbitrary
|
6379
6488
|
keys. Because it is commonly used in low-level bookkeeping, Map is
|
6380
6489
|
implemented as a pure JavaScript object for performance.
|
6381
6490
|
|
@@ -6385,7 +6494,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
6385
6494
|
forEach method for iteration.
|
6386
6495
|
|
6387
6496
|
Map is mocked out to look like an Ember object, so you can do
|
6388
|
-
`
|
6497
|
+
`EmberMap.create()` for symmetry with other Ember classes.
|
6389
6498
|
*/
|
6390
6499
|
function missingFunction(fn) {
|
6391
6500
|
throw new TypeError(Object.prototype.toString.call(fn) + ' is not a function');
|
@@ -6593,7 +6702,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
6593
6702
|
Internally, a Map has two data structures:
|
6594
6703
|
|
6595
6704
|
1. `keys`: an OrderedSet of all of the existing keys
|
6596
|
-
2. `values`: a JavaScript Object indexed by the `
|
6705
|
+
2. `values`: a JavaScript Object indexed by the `guidFor(key)`
|
6597
6706
|
|
6598
6707
|
When a key/value pair is added for the first time, we
|
6599
6708
|
add the key to the `keys` OrderedSet, and create or
|
@@ -6798,7 +6907,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
6798
6907
|
@param [options]
|
6799
6908
|
@param {*} [options.defaultValue]
|
6800
6909
|
@return {Ember.MapWithDefault|Ember.Map} If options are passed, returns
|
6801
|
-
`
|
6910
|
+
`MapWithDefault` otherwise returns `EmberMap`
|
6802
6911
|
@private
|
6803
6912
|
*/
|
6804
6913
|
MapWithDefault.create = function (options) {
|
@@ -6847,23 +6956,32 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
6847
6956
|
};
|
6848
6957
|
|
6849
6958
|
/**
|
6850
|
-
|
6959
|
+
@module @ember/object
|
6960
|
+
*/
|
6961
|
+
|
6962
|
+
/**
|
6963
|
+
To get multiple properties at once, call `getProperties`
|
6851
6964
|
with an object followed by a list of strings or an array:
|
6852
6965
|
|
6853
6966
|
```javascript
|
6854
|
-
|
6967
|
+
import { getProperties } from '@ember/object';
|
6968
|
+
|
6969
|
+
getProperties(record, 'firstName', 'lastName', 'zipCode');
|
6855
6970
|
// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
|
6856
6971
|
```
|
6857
6972
|
|
6858
6973
|
is equivalent to:
|
6859
6974
|
|
6860
6975
|
```javascript
|
6861
|
-
|
6976
|
+
import { getProperties } from '@ember/object';
|
6977
|
+
|
6978
|
+
getProperties(record, ['firstName', 'lastName', 'zipCode']);
|
6862
6979
|
// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
|
6863
6980
|
```
|
6864
6981
|
|
6865
6982
|
@method getProperties
|
6866
|
-
@
|
6983
|
+
@static
|
6984
|
+
@for @ember/object
|
6867
6985
|
@param {Object} obj
|
6868
6986
|
@param {String...|Array} list of keys to get
|
6869
6987
|
@return {Object}
|
@@ -6884,6 +7002,9 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
6884
7002
|
return ret;
|
6885
7003
|
}
|
6886
7004
|
|
7005
|
+
/**
|
7006
|
+
@module @ember/object
|
7007
|
+
*/
|
6887
7008
|
/**
|
6888
7009
|
Set a list of properties on an object. These properties are set inside
|
6889
7010
|
a single `beginPropertyChanges` and `endPropertyChanges` batch, so
|
@@ -6900,6 +7021,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
6900
7021
|
```
|
6901
7022
|
|
6902
7023
|
@method setProperties
|
7024
|
+
@static
|
7025
|
+
@for @ember/object
|
6903
7026
|
@param obj
|
6904
7027
|
@param {Object} properties
|
6905
7028
|
@return properties
|
@@ -6923,7 +7046,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
6923
7046
|
}
|
6924
7047
|
|
6925
7048
|
/**
|
6926
|
-
@module ember
|
7049
|
+
@module @ember/object
|
6927
7050
|
*/
|
6928
7051
|
|
6929
7052
|
var AFTER_OBSERVERS = ':change';
|
@@ -6939,7 +7062,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
6939
7062
|
|
6940
7063
|
/**
|
6941
7064
|
@method addObserver
|
6942
|
-
@
|
7065
|
+
@static
|
7066
|
+
@for @ember/object/observers
|
6943
7067
|
@param obj
|
6944
7068
|
@param {String} _path
|
6945
7069
|
@param {Object|Function} target
|
@@ -6959,7 +7083,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
6959
7083
|
|
6960
7084
|
/**
|
6961
7085
|
@method removeObserver
|
6962
|
-
@
|
7086
|
+
@static
|
7087
|
+
@for @ember/object/observers
|
6963
7088
|
@param obj
|
6964
7089
|
@param {String} path
|
6965
7090
|
@param {Object|Function} target
|
@@ -6975,7 +7100,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
6975
7100
|
|
6976
7101
|
/**
|
6977
7102
|
@method _addBeforeObserver
|
6978
|
-
@
|
7103
|
+
@static
|
7104
|
+
@for @ember/object/observers
|
6979
7105
|
@param obj
|
6980
7106
|
@param {String} path
|
6981
7107
|
@param {Object|Function} target
|
@@ -7005,7 +7131,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
7005
7131
|
|
7006
7132
|
/**
|
7007
7133
|
@method removeBeforeObserver
|
7008
|
-
@
|
7134
|
+
@static
|
7135
|
+
@for @ember/object/observers
|
7009
7136
|
@param obj
|
7010
7137
|
@param {String} path
|
7011
7138
|
@param {Object|Function} target
|
@@ -7022,7 +7149,6 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
7022
7149
|
|
7023
7150
|
/**
|
7024
7151
|
@module ember
|
7025
|
-
@submodule ember-metal
|
7026
7152
|
*/
|
7027
7153
|
|
7028
7154
|
// ..........................................................
|
@@ -7503,8 +7629,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
7503
7629
|
}
|
7504
7630
|
|
7505
7631
|
/**
|
7506
|
-
@module ember
|
7507
|
-
@submodule ember-metal
|
7632
|
+
@module @ember/object
|
7508
7633
|
*/
|
7509
7634
|
var a_concat = Array.prototype.concat;
|
7510
7635
|
var isArray = Array.isArray;
|
@@ -7880,7 +8005,6 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
7880
8005
|
|
7881
8006
|
/**
|
7882
8007
|
@method mixin
|
7883
|
-
@for Ember
|
7884
8008
|
@param obj
|
7885
8009
|
@param mixins*
|
7886
8010
|
@return obj
|
@@ -7896,21 +8020,28 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
7896
8020
|
}
|
7897
8021
|
|
7898
8022
|
/**
|
7899
|
-
The `
|
8023
|
+
The `Mixin` class allows you to create mixins, whose properties can be
|
7900
8024
|
added to other classes. For instance,
|
7901
8025
|
|
7902
8026
|
```javascript
|
7903
|
-
|
8027
|
+
import Mixin from '@ember/object/mixin';
|
8028
|
+
|
8029
|
+
const EditableMixin = Mixin.create({
|
7904
8030
|
edit() {
|
7905
8031
|
console.log('starting to edit');
|
7906
8032
|
this.set('isEditing', true);
|
7907
8033
|
},
|
7908
8034
|
isEditing: false
|
7909
8035
|
});
|
8036
|
+
```
|
8037
|
+
|
8038
|
+
```javascript
|
8039
|
+
import EmberObject from '@ember/object';
|
8040
|
+
import EditableMixin from '../mixins/editable';
|
7910
8041
|
|
7911
8042
|
// Mix mixins into classes by passing them as the first arguments to
|
7912
8043
|
// `.extend.`
|
7913
|
-
const Comment =
|
8044
|
+
const Comment = EmberObject.extend(EditableMixin, {
|
7914
8045
|
post: null
|
7915
8046
|
});
|
7916
8047
|
|
@@ -7921,8 +8052,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
7921
8052
|
comment.edit(); // outputs 'starting to edit'
|
7922
8053
|
```
|
7923
8054
|
|
7924
|
-
Note that Mixins are created with `
|
7925
|
-
`
|
8055
|
+
Note that Mixins are created with `Mixin.create`, not
|
8056
|
+
`Mixin.extend`.
|
7926
8057
|
|
7927
8058
|
Note that mixins extend a constructor's prototype so arrays and object literals
|
7928
8059
|
defined as properties will be shared amongst objects that implement the mixin.
|
@@ -7931,28 +8062,43 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
7931
8062
|
|
7932
8063
|
```javascript
|
7933
8064
|
// filters array will be shared amongst any object implementing mixin
|
7934
|
-
|
7935
|
-
|
8065
|
+
import Mixin from '@ember/object/mixin';
|
8066
|
+
import { A } from '@ember/array';
|
8067
|
+
|
8068
|
+
const FilterableMixin = Mixin.create({
|
8069
|
+
filters: A()
|
7936
8070
|
});
|
8071
|
+
```
|
8072
|
+
|
8073
|
+
```javascript
|
8074
|
+
import Mixin from '@ember/object/mixin';
|
8075
|
+
import { A } from '@ember/array';
|
8076
|
+
import { computed } from '@ember/object';
|
7937
8077
|
|
7938
8078
|
// filters will be a separate array for every object implementing the mixin
|
7939
|
-
const FilterableMixin =
|
7940
|
-
filters:
|
7941
|
-
return
|
8079
|
+
const FilterableMixin = Mixin.create({
|
8080
|
+
filters: computed(function() {
|
8081
|
+
return A();
|
7942
8082
|
})
|
7943
8083
|
});
|
8084
|
+
```
|
8085
|
+
|
8086
|
+
```javascript
|
8087
|
+
import Mixin from '@ember/object/mixin';
|
8088
|
+
import { A } from '@ember/array';
|
7944
8089
|
|
7945
8090
|
// filters will be created as a separate array during the object's initialization
|
7946
|
-
const Filterable =
|
8091
|
+
const Filterable = Mixin.create({
|
8092
|
+
filters: null,
|
8093
|
+
|
7947
8094
|
init() {
|
7948
8095
|
this._super(...arguments);
|
7949
|
-
this.set("filters",
|
8096
|
+
this.set("filters", A());
|
7950
8097
|
}
|
7951
8098
|
});
|
7952
8099
|
```
|
7953
8100
|
|
7954
8101
|
@class Mixin
|
7955
|
-
@namespace Ember
|
7956
8102
|
@public
|
7957
8103
|
*/
|
7958
8104
|
|
@@ -7997,6 +8143,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
7997
8143
|
|
7998
8144
|
/**
|
7999
8145
|
@method create
|
8146
|
+
@for @ember/object/mixin
|
8000
8147
|
@static
|
8001
8148
|
@param arguments*
|
8002
8149
|
@public
|
@@ -8015,7 +8162,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
8015
8162
|
};
|
8016
8163
|
|
8017
8164
|
// returns the mixins currently applied to the specified object
|
8018
|
-
// TODO: Make
|
8165
|
+
// TODO: Make `mixin`
|
8019
8166
|
|
8020
8167
|
|
8021
8168
|
Mixin.mixins = function mixins(obj) {
|
@@ -8234,7 +8381,8 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
8234
8381
|
```
|
8235
8382
|
|
8236
8383
|
@method aliasMethod
|
8237
|
-
@
|
8384
|
+
@static
|
8385
|
+
@for @ember/object
|
8238
8386
|
@param {String} methodName name of the method to alias
|
8239
8387
|
@public
|
8240
8388
|
*/
|
@@ -8250,8 +8398,11 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
8250
8398
|
Specify a method that observes property changes.
|
8251
8399
|
|
8252
8400
|
```javascript
|
8253
|
-
|
8254
|
-
|
8401
|
+
import EmberObject from '@ember/object';
|
8402
|
+
import { observer } from '@ember/object';
|
8403
|
+
|
8404
|
+
export default EmberObject.extend({
|
8405
|
+
valueObserver: observer('value', function() {
|
8255
8406
|
// Executes whenever the "value" property changes
|
8256
8407
|
})
|
8257
8408
|
});
|
@@ -8261,11 +8412,12 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
8261
8412
|
enabled.
|
8262
8413
|
|
8263
8414
|
@method observer
|
8264
|
-
@for
|
8415
|
+
@for @ember/object
|
8265
8416
|
@param {String} propertyNames*
|
8266
8417
|
@param {Function} func
|
8267
8418
|
@return func
|
8268
8419
|
@public
|
8420
|
+
@static
|
8269
8421
|
*/
|
8270
8422
|
function observer() {
|
8271
8423
|
var _paths = void 0,
|
@@ -8277,7 +8429,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
8277
8429
|
|
8278
8430
|
if (typeof args[args.length - 1] !== 'function') {
|
8279
8431
|
// revert to old, soft-deprecated argument ordering
|
8280
|
-
true && !false && emberDebug.deprecate('Passing the dependentKeys after the callback function in
|
8432
|
+
true && !false && emberDebug.deprecate('Passing the dependentKeys after the callback function in observer is deprecated. Ensure the callback function is the last argument.', false, { id: 'ember-metal.observer-argument-order', until: '3.0.0' });
|
8281
8433
|
|
8282
8434
|
func = args.shift();
|
8283
8435
|
_paths = args;
|
@@ -8286,10 +8438,10 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
8286
8438
|
_paths = args;
|
8287
8439
|
}
|
8288
8440
|
|
8289
|
-
true && !(typeof func === 'function') && emberDebug.assert('
|
8441
|
+
true && !(typeof func === 'function') && emberDebug.assert('observer called without a function', typeof func === 'function');
|
8290
8442
|
true && !(_paths.length > 0 && _paths.every(function (p) {
|
8291
8443
|
return typeof p === 'string' && p.length;
|
8292
|
-
})) && emberDebug.assert('
|
8444
|
+
})) && emberDebug.assert('observer called without valid path', _paths.length > 0 && _paths.every(function (p) {
|
8293
8445
|
return typeof p === 'string' && p.length;
|
8294
8446
|
}));
|
8295
8447
|
|
@@ -8310,15 +8462,17 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
8310
8462
|
Specify a method that observes property changes.
|
8311
8463
|
|
8312
8464
|
```javascript
|
8313
|
-
|
8465
|
+
import EmberObject from '@ember/object';
|
8466
|
+
|
8467
|
+
EmberObject.extend({
|
8314
8468
|
valueObserver: Ember.immediateObserver('value', function() {
|
8315
8469
|
// Executes whenever the "value" property changes
|
8316
8470
|
})
|
8317
8471
|
});
|
8318
8472
|
```
|
8319
8473
|
|
8320
|
-
In the future, `
|
8321
|
-
`
|
8474
|
+
In the future, `observer` may become asynchronous. In this event,
|
8475
|
+
`immediateObserver` will maintain the synchronous behavior.
|
8322
8476
|
|
8323
8477
|
Also available as `Function.prototype.observesImmediately` if prototype extensions are
|
8324
8478
|
enabled.
|
@@ -8327,12 +8481,12 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
8327
8481
|
@for Ember
|
8328
8482
|
@param {String} propertyNames*
|
8329
8483
|
@param {Function} func
|
8330
|
-
@deprecated Use `
|
8484
|
+
@deprecated Use `observer` instead.
|
8331
8485
|
@return func
|
8332
8486
|
@private
|
8333
8487
|
*/
|
8334
8488
|
function _immediateObserver() {
|
8335
|
-
true && !false && emberDebug.deprecate('Usage of `Ember.immediateObserver` is deprecated, use `
|
8489
|
+
true && !false && emberDebug.deprecate('Usage of `Ember.immediateObserver` is deprecated, use `observer` instead.', false, { id: 'ember-metal.immediate-observer', until: '3.0.0' });
|
8336
8490
|
|
8337
8491
|
for (var i = 0; i < arguments.length; i++) {
|
8338
8492
|
var arg = arguments[i];
|
@@ -8393,6 +8547,11 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
8393
8547
|
return func;
|
8394
8548
|
}
|
8395
8549
|
|
8550
|
+
/**
|
8551
|
+
@module ember
|
8552
|
+
@private
|
8553
|
+
*/
|
8554
|
+
|
8396
8555
|
/**
|
8397
8556
|
Read-only property that returns the result of a container lookup.
|
8398
8557
|
|
@@ -8416,7 +8575,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
8416
8575
|
var desc = this[keyName];
|
8417
8576
|
var owner = emberUtils.getOwner(this) || this.container; // fallback to `container` for backwards compat
|
8418
8577
|
|
8419
|
-
true && !(desc && desc.isDescriptor && desc.type) && emberDebug.assert('InjectedProperties should be defined with the
|
8578
|
+
true && !(desc && desc.isDescriptor && desc.type) && emberDebug.assert('InjectedProperties should be defined with the inject computed property macros.', desc && desc.isDescriptor && desc.type);
|
8420
8579
|
true && !owner && emberDebug.assert('Attempting to lookup an injected property on an object without a container, ensure that the object was instantiated via a container.', owner);
|
8421
8580
|
|
8422
8581
|
return owner.lookup(desc.type + ':' + (desc.name || keyName));
|
@@ -8506,11 +8665,6 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
8506
8665
|
return Descriptor$$1;
|
8507
8666
|
}(Descriptor);
|
8508
8667
|
|
8509
|
-
/**
|
8510
|
-
@module ember
|
8511
|
-
@submodule ember-metal
|
8512
|
-
*/
|
8513
|
-
|
8514
8668
|
exports['default'] = Ember;
|
8515
8669
|
exports.computed = computed;
|
8516
8670
|
exports.cacheFor = cacheFor;
|