ember-source 3.0.0.beta.1 → 3.0.0.beta.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/dist/ember-runtime.js +34 -540
- data/dist/ember-template-compiler.js +125 -604
- data/dist/ember-testing.js +1 -1
- data/dist/ember-tests.js +91 -1280
- data/dist/ember-tests.prod.js +84 -1219
- data/dist/ember.debug.js +173 -603
- data/dist/ember.min.js +383 -393
- data/dist/ember.prod.js +177 -593
- data/package.json +12 -6
- metadata +2 -2
data/dist/ember.debug.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 3.0.0-beta.
|
9
|
+
* @version 3.0.0-beta.2
|
10
10
|
*/
|
11
11
|
|
12
12
|
/*globals process */
|
@@ -9164,15 +9164,6 @@ enifed('backburner', ['exports', 'ember-babel'], function (exports, _emberBabel)
|
|
9164
9164
|
this.globalOptions = globalOptions;
|
9165
9165
|
}
|
9166
9166
|
|
9167
|
-
Queue.prototype.push = function push(target, method, args, stack) {
|
9168
|
-
this._queue.push(target, method, args, stack);
|
9169
|
-
return {
|
9170
|
-
queue: this,
|
9171
|
-
target: target,
|
9172
|
-
method: method
|
9173
|
-
};
|
9174
|
-
};
|
9175
|
-
|
9176
9167
|
Queue.prototype.flush = function flush(sync) {
|
9177
9168
|
var _options = this.options,
|
9178
9169
|
before = _options.before,
|
@@ -9246,16 +9237,10 @@ enifed('backburner', ['exports', 'ember-babel'], function (exports, _emberBabel)
|
|
9246
9237
|
|
9247
9238
|
var queue = this._queue;
|
9248
9239
|
var targetQueueMap = this.targetQueues.get(target);
|
9249
|
-
var index = void 0;
|
9250
9240
|
if (targetQueueMap !== undefined) {
|
9251
|
-
|
9252
|
-
if (index !== undefined) {
|
9253
|
-
targetQueueMap.delete(method);
|
9254
|
-
}
|
9255
|
-
}
|
9256
|
-
if (index === undefined) {
|
9257
|
-
index = findItem(target, method, queue);
|
9241
|
+
targetQueueMap.delete(method);
|
9258
9242
|
}
|
9243
|
+
var index = findItem(target, method, queue);
|
9259
9244
|
if (index > -1) {
|
9260
9245
|
queue.splice(index, 4);
|
9261
9246
|
return true;
|
@@ -9271,6 +9256,15 @@ enifed('backburner', ['exports', 'ember-babel'], function (exports, _emberBabel)
|
|
9271
9256
|
return false;
|
9272
9257
|
};
|
9273
9258
|
|
9259
|
+
Queue.prototype.push = function push(target, method, args, stack) {
|
9260
|
+
this._queue.push(target, method, args, stack);
|
9261
|
+
return {
|
9262
|
+
queue: this,
|
9263
|
+
target: target,
|
9264
|
+
method: method
|
9265
|
+
};
|
9266
|
+
};
|
9267
|
+
|
9274
9268
|
Queue.prototype.pushUnique = function pushUnique(target, method, args, stack) {
|
9275
9269
|
var localQueueMap = this.targetQueues.get(target);
|
9276
9270
|
if (localQueueMap === undefined) {
|
@@ -9345,10 +9339,10 @@ enifed('backburner', ['exports', 'ember-babel'], function (exports, _emberBabel)
|
|
9345
9339
|
DeferredActionQueues.prototype.schedule = function schedule(queueName, target, method, args, onceFlag, stack) {
|
9346
9340
|
var queues = this.queues;
|
9347
9341
|
var queue = queues[queueName];
|
9348
|
-
if (
|
9342
|
+
if (queue === undefined) {
|
9349
9343
|
noSuchQueue(queueName);
|
9350
9344
|
}
|
9351
|
-
if (
|
9345
|
+
if (method === undefined || method === null) {
|
9352
9346
|
noSuchMethod(queueName);
|
9353
9347
|
}
|
9354
9348
|
if (onceFlag) {
|
@@ -9683,25 +9677,42 @@ enifed('backburner', ['exports', 'ember-babel'], function (exports, _emberBabel)
|
|
9683
9677
|
return this._setTimeout(fn, executeAt);
|
9684
9678
|
};
|
9685
9679
|
|
9686
|
-
Backburner.prototype.throttle = function throttle(
|
9680
|
+
Backburner.prototype.throttle = function throttle(targetOrThisArgOrMethod) {
|
9687
9681
|
var _this2 = this;
|
9688
9682
|
|
9689
|
-
|
9690
|
-
|
9691
|
-
|
9692
|
-
|
9693
|
-
var immediate = args.pop();
|
9683
|
+
var target = void 0;
|
9684
|
+
var method = void 0;
|
9685
|
+
var immediate = void 0;
|
9694
9686
|
var isImmediate = void 0;
|
9695
9687
|
var wait = void 0;
|
9696
|
-
|
9697
|
-
|
9688
|
+
|
9689
|
+
for (var _len4 = arguments.length, args = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
|
9690
|
+
args[_key4 - 1] = arguments[_key4];
|
9691
|
+
}
|
9692
|
+
|
9693
|
+
if (args.length === 1) {
|
9694
|
+
method = targetOrThisArgOrMethod;
|
9695
|
+
wait = args.pop();
|
9696
|
+
target = null;
|
9698
9697
|
isImmediate = true;
|
9699
9698
|
} else {
|
9700
|
-
|
9701
|
-
|
9702
|
-
|
9703
|
-
|
9704
|
-
|
9699
|
+
target = targetOrThisArgOrMethod;
|
9700
|
+
method = args.shift();
|
9701
|
+
immediate = args.pop();
|
9702
|
+
if (isString(method)) {
|
9703
|
+
method = target[method];
|
9704
|
+
} else if (!isFunction(method)) {
|
9705
|
+
args.unshift(method);
|
9706
|
+
method = target;
|
9707
|
+
target = null;
|
9708
|
+
}
|
9709
|
+
if (isCoercableNumber(immediate)) {
|
9710
|
+
wait = immediate;
|
9711
|
+
isImmediate = true;
|
9712
|
+
} else {
|
9713
|
+
wait = args.pop();
|
9714
|
+
isImmediate = immediate === true;
|
9715
|
+
}
|
9705
9716
|
}
|
9706
9717
|
var index = findItem(target, method, this._throttlers);
|
9707
9718
|
if (index > -1) {
|
@@ -9728,25 +9739,42 @@ enifed('backburner', ['exports', 'ember-babel'], function (exports, _emberBabel)
|
|
9728
9739
|
return timer;
|
9729
9740
|
};
|
9730
9741
|
|
9731
|
-
Backburner.prototype.debounce = function debounce(
|
9742
|
+
Backburner.prototype.debounce = function debounce(targetOrThisArgOrMethod) {
|
9732
9743
|
var _this3 = this;
|
9733
9744
|
|
9734
|
-
|
9735
|
-
|
9736
|
-
|
9737
|
-
|
9738
|
-
var immediate = args.pop();
|
9745
|
+
var target = void 0;
|
9746
|
+
var method = void 0;
|
9747
|
+
var immediate = void 0;
|
9739
9748
|
var isImmediate = void 0;
|
9740
9749
|
var wait = void 0;
|
9741
|
-
|
9742
|
-
|
9750
|
+
|
9751
|
+
for (var _len5 = arguments.length, args = Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {
|
9752
|
+
args[_key5 - 1] = arguments[_key5];
|
9753
|
+
}
|
9754
|
+
|
9755
|
+
if (args.length === 1) {
|
9756
|
+
method = targetOrThisArgOrMethod;
|
9757
|
+
wait = args.pop();
|
9758
|
+
target = null;
|
9743
9759
|
isImmediate = false;
|
9744
9760
|
} else {
|
9745
|
-
|
9746
|
-
|
9747
|
-
|
9748
|
-
|
9749
|
-
|
9761
|
+
target = targetOrThisArgOrMethod;
|
9762
|
+
method = args.shift();
|
9763
|
+
immediate = args.pop();
|
9764
|
+
if (isString(method)) {
|
9765
|
+
method = target[method];
|
9766
|
+
} else if (!isFunction(method)) {
|
9767
|
+
args.unshift(method);
|
9768
|
+
method = target;
|
9769
|
+
target = null;
|
9770
|
+
}
|
9771
|
+
if (isCoercableNumber(immediate)) {
|
9772
|
+
wait = immediate;
|
9773
|
+
isImmediate = false;
|
9774
|
+
} else {
|
9775
|
+
wait = args.pop();
|
9776
|
+
isImmediate = immediate === true;
|
9777
|
+
}
|
9750
9778
|
}
|
9751
9779
|
wait = parseInt(wait, 10);
|
9752
9780
|
// Remove debouncee
|
@@ -11159,7 +11187,7 @@ enifed('ember-application/initializers/dom-templates', ['require', 'ember-glimme
|
|
11159
11187
|
}
|
11160
11188
|
});
|
11161
11189
|
});
|
11162
|
-
enifed('ember-application/system/application-instance', ['exports', 'ember-utils', 'ember-metal', 'ember-
|
11190
|
+
enifed('ember-application/system/application-instance', ['exports', 'ember-utils', 'ember-metal', 'ember-environment', 'ember-views', 'ember-application/system/engine-instance', 'ember-glimmer'], function (exports, _emberUtils, _emberMetal, _emberEnvironment, _emberViews, _engineInstance, _emberGlimmer) {
|
11163
11191
|
'use strict';
|
11164
11192
|
|
11165
11193
|
/**
|
@@ -11320,13 +11348,9 @@ enifed('ember-application/system/application-instance', ['exports', 'ember-utils
|
|
11320
11348
|
// No rendering is needed, and routing has completed, simply return.
|
11321
11349
|
return _this;
|
11322
11350
|
} else {
|
11323
|
-
|
11324
|
-
|
11325
|
-
|
11326
|
-
// a scheduled revalidation (into the `render` queue) in the Renderer.
|
11327
|
-
//
|
11328
|
-
// This uses `run.schedule('afterRender', ....)` to resolve after that rendering has completed.
|
11329
|
-
_emberMetal.run.schedule('afterRender', null, resolve, _this);
|
11351
|
+
// Ensure that the visit promise resolves when all rendering has completed
|
11352
|
+
return (0, _emberGlimmer.renderSettled)().then(function () {
|
11353
|
+
return _this;
|
11330
11354
|
});
|
11331
11355
|
}
|
11332
11356
|
};
|
@@ -13129,9 +13153,17 @@ enifed("ember-console", ["exports"], function (exports) {
|
|
13129
13153
|
return (_console4 = console).info.apply(_console4, arguments);
|
13130
13154
|
},
|
13131
13155
|
debug: function () {
|
13132
|
-
var
|
13156
|
+
var _console6;
|
13133
13157
|
|
13134
|
-
|
13158
|
+
/* eslint-disable no-console */
|
13159
|
+
if (console.debug) {
|
13160
|
+
var _console5;
|
13161
|
+
|
13162
|
+
return (_console5 = console).debug.apply(_console5, arguments);
|
13163
|
+
}
|
13164
|
+
|
13165
|
+
return (_console6 = console).info.apply(_console6, arguments);
|
13166
|
+
/* eslint-enable no-console */
|
13135
13167
|
},
|
13136
13168
|
assert: function () {
|
13137
13169
|
var _console7;
|
@@ -18803,6 +18835,12 @@ enifed('ember-glimmer/index', ['exports', 'ember-glimmer/helpers/action', 'ember
|
|
18803
18835
|
return _renderer._resetRenderers;
|
18804
18836
|
}
|
18805
18837
|
});
|
18838
|
+
Object.defineProperty(exports, 'renderSettled', {
|
18839
|
+
enumerable: true,
|
18840
|
+
get: function () {
|
18841
|
+
return _renderer.renderSettled;
|
18842
|
+
}
|
18843
|
+
});
|
18806
18844
|
Object.defineProperty(exports, 'getTemplate', {
|
18807
18845
|
enumerable: true,
|
18808
18846
|
get: function () {
|
@@ -19136,11 +19174,12 @@ enifed('ember-glimmer/protocol-for-url', ['exports', 'ember-environment', 'node-
|
|
19136
19174
|
return protocol === null ? ':' : protocol;
|
19137
19175
|
}
|
19138
19176
|
});
|
19139
|
-
enifed('ember-glimmer/renderer', ['exports', 'ember-babel', '@glimmer/reference', 'ember-debug', 'ember-metal', 'ember-views', 'ember-glimmer/component', 'ember-glimmer/component-managers/outlet', 'ember-glimmer/component-managers/root', 'ember-glimmer/utils/references', '@glimmer/runtime'], function (exports, _emberBabel, _reference, _emberDebug, _emberMetal, _emberViews, _component, _outlet, _root2, _references, _runtime) {
|
19177
|
+
enifed('ember-glimmer/renderer', ['exports', 'ember-babel', '@glimmer/reference', 'ember-debug', 'ember-metal', 'ember-views', 'ember-glimmer/component', 'ember-glimmer/component-managers/outlet', 'ember-glimmer/component-managers/root', 'ember-glimmer/utils/references', '@glimmer/runtime', 'rsvp'], function (exports, _emberBabel, _reference, _emberDebug, _emberMetal, _emberViews, _component, _outlet, _root2, _references, _runtime, _rsvp) {
|
19140
19178
|
'use strict';
|
19141
19179
|
|
19142
19180
|
exports.InteractiveRenderer = exports.InertRenderer = exports.Renderer = exports.DynamicScope = undefined;
|
19143
19181
|
exports._resetRenderers = _resetRenderers;
|
19182
|
+
exports.renderSettled = renderSettled;
|
19144
19183
|
var backburner = _emberMetal.run.backburner;
|
19145
19184
|
|
19146
19185
|
var DynamicScope = exports.DynamicScope = function () {
|
@@ -19264,6 +19303,35 @@ enifed('ember-glimmer/renderer', ['exports', 'ember-babel', '@glimmer/reference'
|
|
19264
19303
|
}
|
19265
19304
|
}
|
19266
19305
|
function K() {}
|
19306
|
+
var renderSettledDeferred = null;
|
19307
|
+
/*
|
19308
|
+
Returns a promise which will resolve when rendering has settled. Settled in
|
19309
|
+
this context is defined as when all of the tags in use are "current" (e.g.
|
19310
|
+
`renderers.every(r => r._isValid())`). When this is checked at the _end_ of
|
19311
|
+
the run loop, this essentially guarantees that all rendering is completed.
|
19312
|
+
|
19313
|
+
@method renderSettled
|
19314
|
+
@returns {Promise<void>} a promise which fulfills when rendering has settled
|
19315
|
+
*/
|
19316
|
+
function renderSettled() {
|
19317
|
+
if (renderSettledDeferred === null) {
|
19318
|
+
renderSettledDeferred = _rsvp.default.defer();
|
19319
|
+
// if there is no current runloop, the promise created above will not have
|
19320
|
+
// a chance to resolve (because its resolved in backburner's "end" event)
|
19321
|
+
if (!_emberMetal.run.currentRunLoop) {
|
19322
|
+
// ensure a runloop has been kicked off
|
19323
|
+
backburner.schedule('actions', null, K);
|
19324
|
+
}
|
19325
|
+
}
|
19326
|
+
return renderSettledDeferred.promise;
|
19327
|
+
}
|
19328
|
+
function resolveRenderPromise() {
|
19329
|
+
if (renderSettledDeferred !== null) {
|
19330
|
+
var resolve = renderSettledDeferred.resolve;
|
19331
|
+
renderSettledDeferred = null;
|
19332
|
+
backburner.join(null, resolve);
|
19333
|
+
}
|
19334
|
+
}
|
19267
19335
|
var loops = 0;
|
19268
19336
|
function loopEnd() {
|
19269
19337
|
for (var i = 0; i < renderers.length; i++) {
|
@@ -19279,6 +19347,7 @@ enifed('ember-glimmer/renderer', ['exports', 'ember-babel', '@glimmer/reference'
|
|
19279
19347
|
}
|
19280
19348
|
}
|
19281
19349
|
loops = 0;
|
19350
|
+
resolveRenderPromise();
|
19282
19351
|
}
|
19283
19352
|
backburner.on('begin', loopBegin);
|
19284
19353
|
backburner.on('end', loopEnd);
|
@@ -21816,12 +21885,11 @@ enifed('ember-glimmer/views/outlet', ['exports', 'ember-babel', '@glimmer/refere
|
|
21816
21885
|
|
21817
21886
|
exports.default = OutletView;
|
21818
21887
|
});
|
21819
|
-
enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-debug', 'ember/features', 'ember-babel', '@glimmer/reference', 'require', 'backburner'
|
21888
|
+
enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-debug', 'ember/features', 'ember-babel', '@glimmer/reference', 'require', 'backburner'], function (exports, emberEnvironment, emberUtils, emberDebug, features, emberBabel, reference, require, Backburner) {
|
21820
21889
|
'use strict';
|
21821
21890
|
|
21822
21891
|
require = require && require.hasOwnProperty('default') ? require['default'] : require;
|
21823
21892
|
Backburner = Backburner && Backburner.hasOwnProperty('default') ? Backburner['default'] : Backburner;
|
21824
|
-
Logger = Logger && Logger.hasOwnProperty('default') ? Logger['default'] : Logger;
|
21825
21893
|
|
21826
21894
|
/**
|
21827
21895
|
@module ember
|
@@ -23175,7 +23243,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
23175
23243
|
// development to aid in development asertions. Production builds of
|
23176
23244
|
// ember strip this entire branch out.
|
23177
23245
|
var messageFor = function (obj, keyName, property, value) {
|
23178
|
-
return 'You attempted to access the `' + keyName + '.' + property + '` property ' + ('(of ' + obj + '). Due to certain internal implementation details of Ember, ') + ('the `' + keyName + '` property previously contained an internal "descriptor" ') + ('object (a private API), therefore `' + keyName + '.' + property + '` would have ') + ('been `' + String(value).replace(/\n/g, ' ') + '`. This internal implementation ') + 'detail was never intended to be a public (or even intimate) API.\n\n' + 'This internal implementation detail has now changed and the (still private) ' + '"descriptor" object has been relocated to the object\'s "meta" (also a ' + ('private API). Soon, accessing `' + keyName + '` on this object will ') + 'return the computed value (see RFC #281 for more details).\n\n' + 'If you are seeing this error, you are likely using an addon that ' + 'relies on this now-defunct private implementation detail. If you can, ' + 'find out which addon is doing this from the stack trace below and ' + 'report this bug to the addon authors. If you feel stuck, the Ember ' + 'Community Slack (https://ember-community-slackin.herokuapp.com/) ' + 'may be able to offer some help.\n\n' + 'If you are an addon author and need help transitioning your code, ' + 'please get in touch in the #dev-ember channel in the Ember Community ' + 'Slack.';
|
23246
|
+
return 'You attempted to access the `' + keyName + '.' + String(property) + '` property ' + ('(of ' + obj + '). Due to certain internal implementation details of Ember, ') + ('the `' + keyName + '` property previously contained an internal "descriptor" ') + ('object (a private API), therefore `' + keyName + '.' + String(property) + '` would have ') + ('been `' + String(value).replace(/\n/g, ' ') + '`. This internal implementation ') + 'detail was never intended to be a public (or even intimate) API.\n\n' + 'This internal implementation detail has now changed and the (still private) ' + '"descriptor" object has been relocated to the object\'s "meta" (also a ' + ('private API). Soon, accessing `' + keyName + '` on this object will ') + 'return the computed value (see RFC #281 for more details).\n\n' + 'If you are seeing this error, you are likely using an addon that ' + 'relies on this now-defunct private implementation detail. If you can, ' + 'find out which addon is doing this from the stack trace below and ' + 'report this bug to the addon authors. If you feel stuck, the Ember ' + 'Community Slack (https://ember-community-slackin.herokuapp.com/) ' + 'may be able to offer some help.\n\n' + 'If you are an addon author and need help transitioning your code, ' + 'please get in touch in the #dev-ember channel in the Ember Community ' + 'Slack.';
|
23179
23247
|
};
|
23180
23248
|
|
23181
23249
|
var trapFor = void 0;
|
@@ -23187,7 +23255,9 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
23187
23255
|
get: function (descriptor, property) {
|
23188
23256
|
if (property === DESCRIPTOR) {
|
23189
23257
|
return descriptor;
|
23190
|
-
} else if (property === '
|
23258
|
+
} else if (property === 'prototype' || property === 'constructor' || property === 'nodeType') {
|
23259
|
+
return undefined;
|
23260
|
+
} else if (property === 'toString' || property === 'valueOf' || property === 'inspect' || Symbol && property === Symbol.toPrimitive || Symbol && property === Symbol.toStringTag) {
|
23191
23261
|
return function () {
|
23192
23262
|
return '[COMPUTED PROPERTY]';
|
23193
23263
|
};
|
@@ -23939,7 +24009,9 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
23939
24009
|
|
23940
24010
|
this._watching = undefined;
|
23941
24011
|
this._mixins = undefined;
|
23942
|
-
|
24012
|
+
if (emberEnvironment.ENV._ENABLE_BINDING_SUPPORT) {
|
24013
|
+
this._bindings = undefined;
|
24014
|
+
}
|
23943
24015
|
this._values = undefined;
|
23944
24016
|
this._deps = undefined;
|
23945
24017
|
this._chainWatchers = undefined;
|
@@ -24262,6 +24334,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
24262
24334
|
};
|
24263
24335
|
|
24264
24336
|
Meta.prototype.writeBindings = function writeBindings(subkey, value) {
|
24337
|
+
true && !emberEnvironment.ENV._ENABLE_BINDING_SUPPORT && emberDebug.assert('Cannot invoke `meta.writeBindings` when EmberENV._ENABLE_BINDING_SUPPORT is not set', emberEnvironment.ENV._ENABLE_BINDING_SUPPORT);
|
24265
24338
|
true && !!this.isMetaDestroyed() && emberDebug.assert('Cannot add a binding for `' + subkey + '` on `' + emberUtils.toString(this.source) + '` after it has been destroyed.', !this.isMetaDestroyed());
|
24266
24339
|
|
24267
24340
|
var map = this._getOrCreateOwnMap('_bindings');
|
@@ -24269,10 +24342,14 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
24269
24342
|
};
|
24270
24343
|
|
24271
24344
|
Meta.prototype.peekBindings = function peekBindings(subkey) {
|
24345
|
+
true && !emberEnvironment.ENV._ENABLE_BINDING_SUPPORT && emberDebug.assert('Cannot invoke `meta.peekBindings` when EmberENV._ENABLE_BINDING_SUPPORT is not set', emberEnvironment.ENV._ENABLE_BINDING_SUPPORT);
|
24346
|
+
|
24272
24347
|
return this._findInherited('_bindings', subkey);
|
24273
24348
|
};
|
24274
24349
|
|
24275
24350
|
Meta.prototype.forEachBindings = function forEachBindings(fn) {
|
24351
|
+
true && !emberEnvironment.ENV._ENABLE_BINDING_SUPPORT && emberDebug.assert('Cannot invoke `meta.forEachBindings` when EmberENV._ENABLE_BINDING_SUPPORT is not set', emberEnvironment.ENV._ENABLE_BINDING_SUPPORT);
|
24352
|
+
|
24276
24353
|
var pointer = this;
|
24277
24354
|
var seen = void 0;
|
24278
24355
|
while (pointer !== undefined) {
|
@@ -24291,6 +24368,7 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
24291
24368
|
};
|
24292
24369
|
|
24293
24370
|
Meta.prototype.clearBindings = function clearBindings() {
|
24371
|
+
true && !emberEnvironment.ENV._ENABLE_BINDING_SUPPORT && emberDebug.assert('Cannot invoke `meta.clearBindings` when EmberENV._ENABLE_BINDING_SUPPORT is not set', emberEnvironment.ENV._ENABLE_BINDING_SUPPORT);
|
24294
24372
|
true && !!this.isMetaDestroyed() && emberDebug.assert('Cannot clear bindings on `' + emberUtils.toString(this.source) + '` after it has been destroyed.', !this.isMetaDestroyed());
|
24295
24373
|
|
24296
24374
|
this._bindings = undefined;
|
@@ -24648,14 +24726,6 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
24648
24726
|
return firstDotIndexCache.get(path) !== -1;
|
24649
24727
|
}
|
24650
24728
|
|
24651
|
-
function getFirstKey(path) {
|
24652
|
-
return firstKeyCache.get(path);
|
24653
|
-
}
|
24654
|
-
|
24655
|
-
function getTailPath(path) {
|
24656
|
-
return tailPathCache.get(path);
|
24657
|
-
}
|
24658
|
-
|
24659
24729
|
/**
|
24660
24730
|
@module @ember/object
|
24661
24731
|
*/
|
@@ -27626,489 +27696,6 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
27626
27696
|
return properties;
|
27627
27697
|
}
|
27628
27698
|
|
27629
|
-
/**
|
27630
|
-
@module ember
|
27631
|
-
*/
|
27632
|
-
|
27633
|
-
// ..........................................................
|
27634
|
-
// BINDING
|
27635
|
-
//
|
27636
|
-
|
27637
|
-
var Binding = function () {
|
27638
|
-
function Binding(toPath, fromPath) {
|
27639
|
-
emberBabel.classCallCheck(this, Binding);
|
27640
|
-
|
27641
|
-
// Configuration
|
27642
|
-
this._from = fromPath;
|
27643
|
-
this._to = toPath;
|
27644
|
-
this._oneWay = undefined;
|
27645
|
-
|
27646
|
-
// State
|
27647
|
-
this._direction = undefined;
|
27648
|
-
this._readyToSync = undefined;
|
27649
|
-
this._fromObj = undefined;
|
27650
|
-
this._fromPath = undefined;
|
27651
|
-
this._toObj = undefined;
|
27652
|
-
}
|
27653
|
-
|
27654
|
-
/**
|
27655
|
-
@class Binding
|
27656
|
-
@namespace Ember
|
27657
|
-
@deprecated See https://emberjs.com/deprecations/v2.x#toc_ember-binding
|
27658
|
-
@public
|
27659
|
-
*/
|
27660
|
-
|
27661
|
-
/**
|
27662
|
-
This copies the Binding so it can be connected to another object.
|
27663
|
-
@method copy
|
27664
|
-
@return {Ember.Binding} `this`
|
27665
|
-
@public
|
27666
|
-
*/
|
27667
|
-
|
27668
|
-
Binding.prototype.copy = function copy() {
|
27669
|
-
var copy = new Binding(this._to, this._from);
|
27670
|
-
if (this._oneWay) {
|
27671
|
-
copy._oneWay = true;
|
27672
|
-
}
|
27673
|
-
return copy;
|
27674
|
-
};
|
27675
|
-
|
27676
|
-
// ..........................................................
|
27677
|
-
// CONFIG
|
27678
|
-
//
|
27679
|
-
|
27680
|
-
/**
|
27681
|
-
This will set `from` property path to the specified value. It will not
|
27682
|
-
attempt to resolve this property path to an actual object until you
|
27683
|
-
connect the binding.
|
27684
|
-
The binding will search for the property path starting at the root object
|
27685
|
-
you pass when you `connect()` the binding. It follows the same rules as
|
27686
|
-
`get()` - see that method for more information.
|
27687
|
-
@method from
|
27688
|
-
@param {String} path The property path to connect to.
|
27689
|
-
@return {Ember.Binding} `this`
|
27690
|
-
@public
|
27691
|
-
*/
|
27692
|
-
|
27693
|
-
Binding.prototype.from = function from(path) {
|
27694
|
-
this._from = path;
|
27695
|
-
return this;
|
27696
|
-
};
|
27697
|
-
|
27698
|
-
/**
|
27699
|
-
This will set the `to` property path to the specified value. It will not
|
27700
|
-
attempt to resolve this property path to an actual object until you
|
27701
|
-
connect the binding.
|
27702
|
-
The binding will search for the property path starting at the root object
|
27703
|
-
you pass when you `connect()` the binding. It follows the same rules as
|
27704
|
-
`get()` - see that method for more information.
|
27705
|
-
@method to
|
27706
|
-
@param {String|Tuple} path A property path or tuple.
|
27707
|
-
@return {Ember.Binding} `this`
|
27708
|
-
@public
|
27709
|
-
*/
|
27710
|
-
|
27711
|
-
Binding.prototype.to = function to(path) {
|
27712
|
-
this._to = path;
|
27713
|
-
return this;
|
27714
|
-
};
|
27715
|
-
|
27716
|
-
/**
|
27717
|
-
Configures the binding as one way. A one-way binding will relay changes
|
27718
|
-
on the `from` side to the `to` side, but not the other way around. This
|
27719
|
-
means that if you change the `to` side directly, the `from` side may have
|
27720
|
-
a different value.
|
27721
|
-
@method oneWay
|
27722
|
-
@return {Ember.Binding} `this`
|
27723
|
-
@public
|
27724
|
-
*/
|
27725
|
-
|
27726
|
-
Binding.prototype.oneWay = function oneWay() {
|
27727
|
-
this._oneWay = true;
|
27728
|
-
return this;
|
27729
|
-
};
|
27730
|
-
|
27731
|
-
/**
|
27732
|
-
@method toString
|
27733
|
-
@return {String} string representation of binding
|
27734
|
-
@public
|
27735
|
-
*/
|
27736
|
-
|
27737
|
-
Binding.prototype.toString = function toString$$1() {
|
27738
|
-
var oneWay = this._oneWay ? '[oneWay]' : '';
|
27739
|
-
return 'Ember.Binding<' + emberUtils.guidFor(this) + '>(' + this._from + ' -> ' + this._to + ')' + oneWay;
|
27740
|
-
};
|
27741
|
-
|
27742
|
-
// ..........................................................
|
27743
|
-
// CONNECT AND SYNC
|
27744
|
-
//
|
27745
|
-
|
27746
|
-
/**
|
27747
|
-
Attempts to connect this binding instance so that it can receive and relay
|
27748
|
-
changes. This method will raise an exception if you have not set the
|
27749
|
-
from/to properties yet.
|
27750
|
-
@method connect
|
27751
|
-
@param {Object} obj The root object for this binding.
|
27752
|
-
@return {Ember.Binding} `this`
|
27753
|
-
@public
|
27754
|
-
*/
|
27755
|
-
|
27756
|
-
Binding.prototype.connect = function connect(obj) {
|
27757
|
-
true && !!!obj && emberDebug.assert('Must pass a valid object to Ember.Binding.connect()', !!obj);
|
27758
|
-
|
27759
|
-
var fromObj = void 0,
|
27760
|
-
fromPath = void 0,
|
27761
|
-
possibleGlobal = void 0;
|
27762
|
-
|
27763
|
-
// If the binding's "from" path could be interpreted as a global, verify
|
27764
|
-
// whether the path refers to a global or not by consulting `Ember.lookup`.
|
27765
|
-
if (isGlobalPath(this._from)) {
|
27766
|
-
var name = getFirstKey(this._from);
|
27767
|
-
possibleGlobal = emberEnvironment.context.lookup[name];
|
27768
|
-
|
27769
|
-
if (possibleGlobal) {
|
27770
|
-
fromObj = possibleGlobal;
|
27771
|
-
fromPath = getTailPath(this._from);
|
27772
|
-
}
|
27773
|
-
}
|
27774
|
-
|
27775
|
-
if (fromObj === undefined) {
|
27776
|
-
fromObj = obj;
|
27777
|
-
fromPath = this._from;
|
27778
|
-
}
|
27779
|
-
|
27780
|
-
trySet(obj, this._to, get(fromObj, fromPath));
|
27781
|
-
|
27782
|
-
// Add an observer on the object to be notified when the binding should be updated.
|
27783
|
-
addObserver(fromObj, fromPath, this, 'fromDidChange');
|
27784
|
-
|
27785
|
-
// If the binding is a two-way binding, also set up an observer on the target.
|
27786
|
-
if (!this._oneWay) {
|
27787
|
-
addObserver(obj, this._to, this, 'toDidChange');
|
27788
|
-
}
|
27789
|
-
|
27790
|
-
addListener(obj, 'willDestroy', this, 'disconnect');
|
27791
|
-
|
27792
|
-
fireDeprecations(obj, this._to, this._from, possibleGlobal, this._oneWay, !possibleGlobal && !this._oneWay);
|
27793
|
-
|
27794
|
-
this._readyToSync = true;
|
27795
|
-
this._fromObj = fromObj;
|
27796
|
-
this._fromPath = fromPath;
|
27797
|
-
this._toObj = obj;
|
27798
|
-
|
27799
|
-
return this;
|
27800
|
-
};
|
27801
|
-
|
27802
|
-
/**
|
27803
|
-
Disconnects the binding instance. Changes will no longer be relayed. You
|
27804
|
-
will not usually need to call this method.
|
27805
|
-
@method disconnect
|
27806
|
-
@return {Ember.Binding} `this`
|
27807
|
-
@public
|
27808
|
-
*/
|
27809
|
-
|
27810
|
-
Binding.prototype.disconnect = function disconnect() {
|
27811
|
-
true && !!!this._toObj && emberDebug.assert('Must pass a valid object to Ember.Binding.disconnect()', !!this._toObj);
|
27812
|
-
|
27813
|
-
// Remove an observer on the object so we're no longer notified of
|
27814
|
-
// changes that should update bindings.
|
27815
|
-
|
27816
|
-
removeObserver(this._fromObj, this._fromPath, this, 'fromDidChange');
|
27817
|
-
|
27818
|
-
// If the binding is two-way, remove the observer from the target as well.
|
27819
|
-
if (!this._oneWay) {
|
27820
|
-
removeObserver(this._toObj, this._to, this, 'toDidChange');
|
27821
|
-
}
|
27822
|
-
|
27823
|
-
this._readyToSync = false; // Disable scheduled syncs...
|
27824
|
-
return this;
|
27825
|
-
};
|
27826
|
-
|
27827
|
-
// ..........................................................
|
27828
|
-
// PRIVATE
|
27829
|
-
//
|
27830
|
-
|
27831
|
-
/* Called when the from side changes. */
|
27832
|
-
|
27833
|
-
Binding.prototype.fromDidChange = function fromDidChange(target) {
|
27834
|
-
// eslint-disable-line no-unused-vars
|
27835
|
-
this._scheduleSync('fwd');
|
27836
|
-
};
|
27837
|
-
|
27838
|
-
/* Called when the to side changes. */
|
27839
|
-
|
27840
|
-
Binding.prototype.toDidChange = function toDidChange(target) {
|
27841
|
-
// eslint-disable-line no-unused-vars
|
27842
|
-
this._scheduleSync('back');
|
27843
|
-
};
|
27844
|
-
|
27845
|
-
Binding.prototype._scheduleSync = function _scheduleSync(dir) {
|
27846
|
-
var existingDir = this._direction;
|
27847
|
-
|
27848
|
-
// If we haven't scheduled the binding yet, schedule it.
|
27849
|
-
if (existingDir === undefined) {
|
27850
|
-
run.schedule('sync', this, '_sync');
|
27851
|
-
this._direction = dir;
|
27852
|
-
}
|
27853
|
-
|
27854
|
-
// If both a 'back' and 'fwd' sync have been scheduled on the same object,
|
27855
|
-
// default to a 'fwd' sync so that it remains deterministic.
|
27856
|
-
if (existingDir === 'back' && dir === 'fwd') {
|
27857
|
-
this._direction = 'fwd';
|
27858
|
-
}
|
27859
|
-
};
|
27860
|
-
|
27861
|
-
Binding.prototype._sync = function _sync() {
|
27862
|
-
var log = emberEnvironment.ENV.LOG_BINDINGS;
|
27863
|
-
|
27864
|
-
var toObj = this._toObj;
|
27865
|
-
|
27866
|
-
// Don't synchronize destroyed objects or disconnected bindings.
|
27867
|
-
if (toObj.isDestroyed || !this._readyToSync) {
|
27868
|
-
return;
|
27869
|
-
}
|
27870
|
-
|
27871
|
-
// Get the direction of the binding for the object we are
|
27872
|
-
// synchronizing from.
|
27873
|
-
var direction = this._direction;
|
27874
|
-
|
27875
|
-
var fromObj = this._fromObj;
|
27876
|
-
var fromPath = this._fromPath;
|
27877
|
-
|
27878
|
-
this._direction = undefined;
|
27879
|
-
|
27880
|
-
// If we're synchronizing from the remote object...
|
27881
|
-
if (direction === 'fwd') {
|
27882
|
-
var fromValue = get(fromObj, fromPath);
|
27883
|
-
if (log) {
|
27884
|
-
Logger.log(' ', this.toString(), '->', fromValue, fromObj);
|
27885
|
-
}
|
27886
|
-
if (this._oneWay) {
|
27887
|
-
trySet(toObj, this._to, fromValue);
|
27888
|
-
} else {
|
27889
|
-
_suspendObserver(toObj, this._to, this, 'toDidChange', function () {
|
27890
|
-
trySet(toObj, this._to, fromValue);
|
27891
|
-
});
|
27892
|
-
}
|
27893
|
-
// If we're synchronizing *to* the remote object.
|
27894
|
-
} else if (direction === 'back') {
|
27895
|
-
var toValue = get(toObj, this._to);
|
27896
|
-
if (log) {
|
27897
|
-
Logger.log(' ', this.toString(), '<-', toValue, toObj);
|
27898
|
-
}
|
27899
|
-
_suspendObserver(fromObj, fromPath, this, 'fromDidChange', function () {
|
27900
|
-
trySet(fromObj, fromPath, toValue);
|
27901
|
-
});
|
27902
|
-
}
|
27903
|
-
};
|
27904
|
-
|
27905
|
-
return Binding;
|
27906
|
-
}();
|
27907
|
-
|
27908
|
-
function fireDeprecations(obj, toPath, fromPath, deprecateGlobal, deprecateOneWay, deprecateAlias) {
|
27909
|
-
var deprecateGlobalMessage = '`Ember.Binding` is deprecated. Since you' + ' are binding to a global consider using a service instead.';
|
27910
|
-
var deprecateOneWayMessage = '`Ember.Binding` is deprecated. Since you' + ' are using a `oneWay` binding consider using a `readOnly` computed' + ' property instead.';
|
27911
|
-
var deprecateAliasMessage = '`Ember.Binding` is deprecated. Consider' + ' using an `alias` computed property instead.';
|
27912
|
-
|
27913
|
-
var objectInfo = 'The `' + toPath + '` property of `' + obj + '` is an `Ember.Binding` connected to `' + fromPath + '`, but ';
|
27914
|
-
true && !!deprecateGlobal && emberDebug.deprecate(objectInfo + deprecateGlobalMessage, !deprecateGlobal, {
|
27915
|
-
id: 'ember-metal.binding',
|
27916
|
-
until: '3.0.0',
|
27917
|
-
url: 'https://emberjs.com/deprecations/v2.x#toc_ember-binding'
|
27918
|
-
});
|
27919
|
-
true && !!deprecateOneWay && emberDebug.deprecate(objectInfo + deprecateOneWayMessage, !deprecateOneWay, {
|
27920
|
-
id: 'ember-metal.binding',
|
27921
|
-
until: '3.0.0',
|
27922
|
-
url: 'https://emberjs.com/deprecations/v2.x#toc_ember-binding'
|
27923
|
-
});
|
27924
|
-
true && !!deprecateAlias && emberDebug.deprecate(objectInfo + deprecateAliasMessage, !deprecateAlias, {
|
27925
|
-
id: 'ember-metal.binding',
|
27926
|
-
until: '3.0.0',
|
27927
|
-
url: 'https://emberjs.com/deprecations/v2.x#toc_ember-binding'
|
27928
|
-
});
|
27929
|
-
}
|
27930
|
-
|
27931
|
-
function mixinProperties$1(to, from) {
|
27932
|
-
for (var key in from) {
|
27933
|
-
if (from.hasOwnProperty(key)) {
|
27934
|
-
to[key] = from[key];
|
27935
|
-
}
|
27936
|
-
}
|
27937
|
-
}
|
27938
|
-
|
27939
|
-
mixinProperties$1(Binding, {
|
27940
|
-
|
27941
|
-
/*
|
27942
|
-
See `Ember.Binding.from`.
|
27943
|
-
@method from
|
27944
|
-
@static
|
27945
|
-
*/
|
27946
|
-
from: function (from) {
|
27947
|
-
var C = this;
|
27948
|
-
return new C(undefined, from);
|
27949
|
-
},
|
27950
|
-
|
27951
|
-
/*
|
27952
|
-
See `Ember.Binding.to`.
|
27953
|
-
@method to
|
27954
|
-
@static
|
27955
|
-
*/
|
27956
|
-
to: function (to) {
|
27957
|
-
var C = this;
|
27958
|
-
return new C(to, undefined);
|
27959
|
-
}
|
27960
|
-
});
|
27961
|
-
/**
|
27962
|
-
An `Ember.Binding` connects the properties of two objects so that whenever
|
27963
|
-
the value of one property changes, the other property will be changed also.
|
27964
|
-
|
27965
|
-
## Automatic Creation of Bindings with `/^*Binding/`-named Properties.
|
27966
|
-
|
27967
|
-
You do not usually create Binding objects directly but instead describe
|
27968
|
-
bindings in your class or object definition using automatic binding
|
27969
|
-
detection.
|
27970
|
-
|
27971
|
-
Properties ending in a `Binding` suffix will be converted to `Ember.Binding`
|
27972
|
-
instances. The value of this property should be a string representing a path
|
27973
|
-
to another object or a custom binding instance created using Binding helpers
|
27974
|
-
(see "One Way Bindings"):
|
27975
|
-
|
27976
|
-
```
|
27977
|
-
valueBinding: "MyApp.someController.title"
|
27978
|
-
```
|
27979
|
-
|
27980
|
-
This will create a binding from `MyApp.someController.title` to the `value`
|
27981
|
-
property of your object instance automatically. Now the two values will be
|
27982
|
-
kept in sync.
|
27983
|
-
|
27984
|
-
## One Way Bindings
|
27985
|
-
|
27986
|
-
One especially useful binding customization you can use is the `oneWay()`
|
27987
|
-
helper. This helper tells Ember that you are only interested in
|
27988
|
-
receiving changes on the object you are binding from. For example, if you
|
27989
|
-
are binding to a preference and you want to be notified if the preference
|
27990
|
-
has changed, but your object will not be changing the preference itself, you
|
27991
|
-
could do:
|
27992
|
-
|
27993
|
-
```
|
27994
|
-
bigTitlesBinding: Ember.Binding.oneWay("MyApp.preferencesController.bigTitles")
|
27995
|
-
```
|
27996
|
-
|
27997
|
-
This way if the value of `MyApp.preferencesController.bigTitles` changes the
|
27998
|
-
`bigTitles` property of your object will change also. However, if you
|
27999
|
-
change the value of your `bigTitles` property, it will not update the
|
28000
|
-
`preferencesController`.
|
28001
|
-
|
28002
|
-
One way bindings are almost twice as fast to setup and twice as fast to
|
28003
|
-
execute because the binding only has to worry about changes to one side.
|
28004
|
-
|
28005
|
-
You should consider using one way bindings anytime you have an object that
|
28006
|
-
may be created frequently and you do not intend to change a property; only
|
28007
|
-
to monitor it for changes (such as in the example above).
|
28008
|
-
|
28009
|
-
## Adding Bindings Manually
|
28010
|
-
|
28011
|
-
All of the examples above show you how to configure a custom binding, but the
|
28012
|
-
result of these customizations will be a binding template, not a fully active
|
28013
|
-
Binding instance. The binding will actually become active only when you
|
28014
|
-
instantiate the object the binding belongs to. It is useful, however, to
|
28015
|
-
understand what actually happens when the binding is activated.
|
28016
|
-
|
28017
|
-
For a binding to function it must have at least a `from` property and a `to`
|
28018
|
-
property. The `from` property path points to the object/key that you want to
|
28019
|
-
bind from while the `to` path points to the object/key you want to bind to.
|
28020
|
-
|
28021
|
-
When you define a custom binding, you are usually describing the property
|
28022
|
-
you want to bind from (such as `MyApp.someController.value` in the examples
|
28023
|
-
above). When your object is created, it will automatically assign the value
|
28024
|
-
you want to bind `to` based on the name of your binding key. In the
|
28025
|
-
examples above, during init, Ember objects will effectively call
|
28026
|
-
something like this on your binding:
|
28027
|
-
|
28028
|
-
```javascript
|
28029
|
-
binding = Ember.Binding.from("valueBinding").to("value");
|
28030
|
-
```
|
28031
|
-
|
28032
|
-
This creates a new binding instance based on the template you provide, and
|
28033
|
-
sets the to path to the `value` property of the new object. Now that the
|
28034
|
-
binding is fully configured with a `from` and a `to`, it simply needs to be
|
28035
|
-
connected to become active. This is done through the `connect()` method:
|
28036
|
-
|
28037
|
-
```javascript
|
28038
|
-
binding.connect(this);
|
28039
|
-
```
|
28040
|
-
|
28041
|
-
Note that when you connect a binding you pass the object you want it to be
|
28042
|
-
connected to. This object will be used as the root for both the from and
|
28043
|
-
to side of the binding when inspecting relative paths. This allows the
|
28044
|
-
binding to be automatically inherited by subclassed objects as well.
|
28045
|
-
|
28046
|
-
This also allows you to bind between objects using the paths you declare in
|
28047
|
-
`from` and `to`:
|
28048
|
-
|
28049
|
-
```javascript
|
28050
|
-
// Example 1
|
28051
|
-
binding = Ember.Binding.from("App.someObject.value").to("value");
|
28052
|
-
binding.connect(this);
|
28053
|
-
|
28054
|
-
// Example 2
|
28055
|
-
binding = Ember.Binding.from("parentView.value").to("App.someObject.value");
|
28056
|
-
binding.connect(this);
|
28057
|
-
```
|
28058
|
-
|
28059
|
-
Now that the binding is connected, it will observe both the from and to side
|
28060
|
-
and relay changes.
|
28061
|
-
|
28062
|
-
If you ever needed to do so (you almost never will, but it is useful to
|
28063
|
-
understand this anyway), you could manually create an active binding by
|
28064
|
-
using the `Ember.bind()` helper method. (This is the same method used by
|
28065
|
-
to setup your bindings on objects):
|
28066
|
-
|
28067
|
-
```javascript
|
28068
|
-
Ember.bind(MyApp.anotherObject, "value", "MyApp.someController.value");
|
28069
|
-
```
|
28070
|
-
|
28071
|
-
Both of these code fragments have the same effect as doing the most friendly
|
28072
|
-
form of binding creation like so:
|
28073
|
-
|
28074
|
-
```javascript
|
28075
|
-
MyApp.anotherObject = Ember.Object.create({
|
28076
|
-
valueBinding: "MyApp.someController.value",
|
28077
|
-
|
28078
|
-
// OTHER CODE FOR THIS OBJECT...
|
28079
|
-
});
|
28080
|
-
```
|
28081
|
-
|
28082
|
-
Ember's built in binding creation method makes it easy to automatically
|
28083
|
-
create bindings for you. You should always use the highest-level APIs
|
28084
|
-
available, even if you understand how it works underneath.
|
28085
|
-
|
28086
|
-
@class Binding
|
28087
|
-
@namespace Ember
|
28088
|
-
@since Ember 0.9
|
28089
|
-
@public
|
28090
|
-
*/
|
28091
|
-
// Ember.Binding = Binding; ES6TODO: where to put this?
|
28092
|
-
|
28093
|
-
|
28094
|
-
/**
|
28095
|
-
Global helper method to create a new binding. Just pass the root object
|
28096
|
-
along with a `to` and `from` path to create and connect the binding.
|
28097
|
-
|
28098
|
-
@method bind
|
28099
|
-
@for Ember
|
28100
|
-
@param {Object} obj The root object of the transform.
|
28101
|
-
@param {String} to The path to the 'to' side of the binding.
|
28102
|
-
Must be relative to obj.
|
28103
|
-
@param {String} from The path to the 'from' side of the binding.
|
28104
|
-
Must be relative to obj or a global path.
|
28105
|
-
@return {Ember.Binding} binding instance
|
28106
|
-
@public
|
28107
|
-
*/
|
28108
|
-
function bind(obj, to, from) {
|
28109
|
-
return new Binding(to, from).connect(obj);
|
28110
|
-
}
|
28111
|
-
|
28112
27699
|
/**
|
28113
27700
|
@module @ember/object
|
28114
27701
|
*/
|
@@ -28343,40 +27930,6 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
28343
27930
|
}
|
28344
27931
|
}
|
28345
27932
|
|
28346
|
-
function detectBinding(key) {
|
28347
|
-
var length = key.length;
|
28348
|
-
|
28349
|
-
return length > 7 && key.charCodeAt(length - 7) === 66 && key.indexOf('inding', length - 6) !== -1;
|
28350
|
-
}
|
28351
|
-
// warm both paths of above function
|
28352
|
-
detectBinding('notbound');
|
28353
|
-
detectBinding('fooBinding');
|
28354
|
-
|
28355
|
-
function connectBindings(obj, meta$$1) {
|
28356
|
-
// TODO Mixin.apply(instance) should disconnect binding if exists
|
28357
|
-
meta$$1.forEachBindings(function (key, binding) {
|
28358
|
-
if (binding) {
|
28359
|
-
var to = key.slice(0, -7); // strip Binding off end
|
28360
|
-
if (binding instanceof Binding) {
|
28361
|
-
binding = binding.copy(); // copy prototypes' instance
|
28362
|
-
binding.to(to);
|
28363
|
-
} else {
|
28364
|
-
// binding is string path
|
28365
|
-
binding = new Binding(to, binding);
|
28366
|
-
}
|
28367
|
-
binding.connect(obj);
|
28368
|
-
obj[key] = binding;
|
28369
|
-
}
|
28370
|
-
});
|
28371
|
-
// mark as applied
|
28372
|
-
meta$$1.clearBindings();
|
28373
|
-
}
|
28374
|
-
|
28375
|
-
function finishPartial(obj, meta$$1) {
|
28376
|
-
connectBindings(obj, meta$$1 === undefined ? meta(obj) : meta$$1);
|
28377
|
-
return obj;
|
28378
|
-
}
|
28379
|
-
|
28380
27933
|
function followAlias(obj, desc, descs, values) {
|
28381
27934
|
var altKey = desc.methodName;
|
28382
27935
|
var value = void 0;
|
@@ -28466,16 +28019,16 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
28466
28019
|
replaceObserversAndListeners(obj, key, obj[key], value);
|
28467
28020
|
}
|
28468
28021
|
|
28469
|
-
if (detectBinding(key)) {
|
28022
|
+
if (emberEnvironment.ENV._ENABLE_BINDING_SUPPORT && Mixin.detectBinding(key)) {
|
28470
28023
|
meta$$1.writeBindings(key, value);
|
28471
28024
|
}
|
28472
28025
|
|
28473
28026
|
defineProperty(obj, key, desc, value, meta$$1);
|
28474
28027
|
}
|
28475
28028
|
|
28476
|
-
if (!partial) {
|
28029
|
+
if (emberEnvironment.ENV._ENABLE_BINDING_SUPPORT && !partial) {
|
28477
28030
|
// don't apply to prototype
|
28478
|
-
finishPartial(obj, meta$$1);
|
28031
|
+
Mixin.finishPartial(obj, meta$$1);
|
28479
28032
|
}
|
28480
28033
|
|
28481
28034
|
return obj;
|
@@ -28754,7 +28307,12 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
28754
28307
|
}();
|
28755
28308
|
|
28756
28309
|
Mixin._apply = applyMixin;
|
28757
|
-
|
28310
|
+
if (emberEnvironment.ENV._ENABLE_BINDING_SUPPORT) {
|
28311
|
+
// slotting this so that the legacy addon can add the function here
|
28312
|
+
// without triggering an error due to the Object.seal done below
|
28313
|
+
Mixin.finishPartial = null;
|
28314
|
+
Mixin.detectBinding = null;
|
28315
|
+
}
|
28758
28316
|
|
28759
28317
|
var MixinPrototype = Mixin.prototype;
|
28760
28318
|
MixinPrototype.toString = Object.toString;
|
@@ -29177,9 +28735,6 @@ enifed('ember-metal', ['exports', 'ember-environment', 'ember-utils', 'ember-deb
|
|
29177
28735
|
exports.REQUIRED = REQUIRED;
|
29178
28736
|
exports.hasUnprocessedMixins = hasUnprocessedMixins;
|
29179
28737
|
exports.clearUnprocessedMixins = clearUnprocessedMixins;
|
29180
|
-
exports.detectBinding = detectBinding;
|
29181
|
-
exports.Binding = Binding;
|
29182
|
-
exports.bind = bind;
|
29183
28738
|
exports.isGlobalPath = isGlobalPath;
|
29184
28739
|
exports.InjectedProperty = InjectedProperty;
|
29185
28740
|
exports.setHasViews = setHasViews;
|
@@ -33844,6 +33399,10 @@ enifed('ember-runtime/compare', ['exports', 'ember-runtime/utils', 'ember-runtim
|
|
33844
33399
|
return (diff > 0) - (diff < 0);
|
33845
33400
|
}
|
33846
33401
|
|
33402
|
+
/**
|
33403
|
+
@module @ember/utils
|
33404
|
+
*/
|
33405
|
+
|
33847
33406
|
/**
|
33848
33407
|
Compares two javascript values and returns:
|
33849
33408
|
|
@@ -33879,7 +33438,8 @@ enifed('ember-runtime/compare', ['exports', 'ember-runtime/utils', 'ember-runtim
|
|
33879
33438
|
```
|
33880
33439
|
|
33881
33440
|
@method compare
|
33882
|
-
@for
|
33441
|
+
@for @ember/utils
|
33442
|
+
@static
|
33883
33443
|
@param {Object} v First value to compare
|
33884
33444
|
@param {Object} w Second value to compare
|
33885
33445
|
@return {Number} -1 if v < w, 0 if v = w and 1 if v > w.
|
@@ -35378,11 +34938,11 @@ enifed('ember-runtime/computed/reduce_computed_macros', ['exports', 'ember-debug
|
|
35378
34938
|
```javascript
|
35379
34939
|
let ToDoList = Ember.Object.extend({
|
35380
34940
|
// using standard ascending sort
|
35381
|
-
todosSorting: ['name'],
|
34941
|
+
todosSorting: Object.freeze(['name']),
|
35382
34942
|
sortedTodos: Ember.computed.sort('todos', 'todosSorting'),
|
35383
34943
|
|
35384
34944
|
// using descending sort
|
35385
|
-
todosSortingDesc: ['name:desc'],
|
34945
|
+
todosSortingDesc: Object.freeze(['name:desc']),
|
35386
34946
|
sortedTodosDesc: Ember.computed.sort('todos', 'todosSortingDesc'),
|
35387
34947
|
|
35388
34948
|
// using a custom sort function
|
@@ -36518,6 +36078,9 @@ enifed('ember-runtime/is-equal', ['exports'], function (exports) {
|
|
36518
36078
|
'use strict';
|
36519
36079
|
|
36520
36080
|
exports.default = isEqual;
|
36081
|
+
/**
|
36082
|
+
@module @ember/utils
|
36083
|
+
*/
|
36521
36084
|
/**
|
36522
36085
|
Compares two objects, returning true if they are equal.
|
36523
36086
|
|
@@ -36550,7 +36113,8 @@ enifed('ember-runtime/is-equal', ['exports'], function (exports) {
|
|
36550
36113
|
```
|
36551
36114
|
|
36552
36115
|
@method isEqual
|
36553
|
-
@for
|
36116
|
+
@for @ember/utils
|
36117
|
+
@static
|
36554
36118
|
@param {Object} a first object to compare
|
36555
36119
|
@param {Object} b second object to compare
|
36556
36120
|
@return {Boolean}
|
@@ -39766,7 +39330,6 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-babel', 'ember-uti
|
|
39766
39330
|
|
39767
39331
|
var schedule = _emberMetal.run.schedule;
|
39768
39332
|
var applyMixin = _emberMetal.Mixin._apply;
|
39769
|
-
var finishPartial = _emberMetal.Mixin.finishPartial;
|
39770
39333
|
var reopen = _emberMetal.Mixin.prototype.reopen;
|
39771
39334
|
|
39772
39335
|
var POST_INIT = exports.POST_INIT = (0, _emberUtils.symbol)('POST_INIT');
|
@@ -39828,7 +39391,7 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-babel', 'ember-uti
|
|
39828
39391
|
var keyName = keyNames[j];
|
39829
39392
|
var value = properties[keyName];
|
39830
39393
|
|
39831
|
-
if (
|
39394
|
+
if (_emberEnvironment.ENV._ENABLE_BINDING_SUPPORT && _emberMetal.Mixin.detectBinding(keyName)) {
|
39832
39395
|
m.writeBindings(keyName, value);
|
39833
39396
|
}
|
39834
39397
|
|
@@ -39871,7 +39434,9 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-babel', 'ember-uti
|
|
39871
39434
|
}
|
39872
39435
|
}
|
39873
39436
|
|
39874
|
-
|
39437
|
+
if (_emberEnvironment.ENV._ENABLE_BINDING_SUPPORT) {
|
39438
|
+
_emberMetal.Mixin.finishPartial(this, m);
|
39439
|
+
}
|
39875
39440
|
|
39876
39441
|
this.init.apply(this, arguments);
|
39877
39442
|
|
@@ -44589,6 +44154,10 @@ enifed('ember-utils', ['exports'], function (exports) {
|
|
44589
44154
|
return obj !== null && obj !== undefined && typeof obj[methodName] === 'function';
|
44590
44155
|
}
|
44591
44156
|
|
44157
|
+
/**
|
44158
|
+
@module @ember/utils
|
44159
|
+
*/
|
44160
|
+
|
44592
44161
|
/**
|
44593
44162
|
Checks to see if the `methodName` exists on the `obj`,
|
44594
44163
|
and if it does, invokes it with the arguments passed.
|
@@ -44602,7 +44171,8 @@ enifed('ember-utils', ['exports'], function (exports) {
|
|
44602
44171
|
```
|
44603
44172
|
|
44604
44173
|
@method tryInvoke
|
44605
|
-
@for
|
44174
|
+
@for @ember/utils
|
44175
|
+
@static
|
44606
44176
|
@param {Object} obj The object to check for the method
|
44607
44177
|
@param {String} methodName The method name to check for
|
44608
44178
|
@param {Array} [args] The arguments to pass to the method
|
@@ -47223,7 +46793,7 @@ enifed('ember/index', ['exports', 'require', 'ember-environment', 'node-module',
|
|
47223
46793
|
enifed("ember/version", ["exports"], function (exports) {
|
47224
46794
|
"use strict";
|
47225
46795
|
|
47226
|
-
exports.default = "3.0.0-beta.
|
46796
|
+
exports.default = "3.0.0-beta.2";
|
47227
46797
|
});
|
47228
46798
|
enifed("handlebars", ["exports"], function (exports) {
|
47229
46799
|
"use strict";
|