dist/ember.debug.js in ember-source-2.18.0.beta.1 vs dist/ember.debug.js in ember-source-2.18.0.beta.2
- old
+ new
@@ -4,11 +4,11 @@
* @copyright Copyright 2011-2017 Tilde Inc. and contributors
* Portions Copyright 2006-2011 Strobe Inc.
* Portions Copyright 2008-2011 Apple Inc. All rights reserved.
* @license Licensed under MIT license
* See https://raw.github.com/emberjs/ember.js/master/LICENSE
- * @version 2.18.0-beta.1
+ * @version 2.18.0-beta.2
*/
/*global process */
var enifed, requireModule, Ember;
var mainContext = this; // Used in ember-environment/lib/global.js
@@ -9257,20 +9257,23 @@
method = _ref.method;
var queue = this._queue;
var guid = this.guidForTarget(target);
var targetQueue = guid ? this.targetQueues[guid] : undefined;
+ var index = void 0;
if (targetQueue !== undefined) {
var t = void 0;
for (var i = 0, l = targetQueue.length; i < l; i += 2) {
t = targetQueue[i];
if (t === method) {
- targetQueue.splice(i, 1);
+ index = targetQueue.splice(i, 2)[1];
}
}
}
- var index = findItem(target, method, queue);
+ if (index === undefined) {
+ index = findItem(target, method, queue);
+ }
if (index > -1) {
queue.splice(index, 4);
return true;
}
// if not found in current queue
@@ -9331,20 +9334,20 @@
this.targetQueues[guid] = [method, this._queue.push(target, method, args, stack) - 4];
}
};
Queue.prototype.invoke = function invoke(target, method, args /*, onError, errorRecordedForStack */) {
- if (args && args.length > 0) {
+ if (args !== undefined) {
method.apply(target, args);
} else {
method.call(target);
}
};
Queue.prototype.invokeWithOnError = function invokeWithOnError(target, method, args, onError, errorRecordedForStack) {
try {
- if (args && args.length > 0) {
+ if (args !== undefined) {
method.apply(target, args);
} else {
method.call(target);
}
} catch (error) {
@@ -9596,47 +9599,20 @@
var _parseArgs = parseArgs.apply(undefined, arguments),
target = _parseArgs[0],
method = _parseArgs[1],
args = _parseArgs[2];
- var onError = getOnError(this.options);
- this.begin();
- if (onError) {
- try {
- return method.apply(target, args);
- } catch (error) {
- onError(error);
- } finally {
- this.end();
- }
- } else {
- try {
- return method.apply(target, args);
- } finally {
- this.end();
- }
- }
+ return this._run(target, method, args);
};
Backburner.prototype.join = function join() {
- if (this.currentInstance === null) {
- return this.run.apply(this, arguments);
- }
-
var _parseArgs2 = parseArgs.apply(undefined, arguments),
target = _parseArgs2[0],
method = _parseArgs2[1],
args = _parseArgs2[2];
- var length = arguments.length;
- if (length === 1) {
- return method();
- } else if (length === 2) {
- return method.call(target);
- } else {
- return method.apply(target, args);
- }
+ return this._join(target, method, args);
};
Backburner.prototype.defer = function defer() {
return this.schedule.apply(this, arguments);
};
@@ -9764,30 +9740,33 @@
isImmediate = true;
} else {
wait = args.pop();
isImmediate = immediate === true;
}
- wait = parseInt(wait, 10);
+ if (isString(method)) {
+ method = target[method];
+ }
var index = findItem(target, method, this._throttlers);
if (index > -1) {
this._throttlers[index + 2] = args;
return this._throttlers[index + 3];
} // throttled
+ wait = parseInt(wait, 10);
var timer = this._platform.setTimeout(function () {
var i = findTimer(timer, _this2._throttlers);
var _throttlers$splice = _this2._throttlers.splice(i, 4),
context = _throttlers$splice[0],
func = _throttlers$splice[1],
params = _throttlers$splice[2];
if (isImmediate === false) {
- _this2.run.apply(_this2, [context, func].concat(params));
+ _this2._run(context, func, params);
}
}, wait);
if (isImmediate) {
- this.join.apply(this, [target, method].concat(args));
+ this._join(target, method, args);
}
this._throttlers.push(target, method, args, timer);
return timer;
};
@@ -9806,10 +9785,13 @@
isImmediate = false;
} else {
wait = args.pop();
isImmediate = immediate === true;
}
+ if (isString(method)) {
+ method = target[method];
+ }
wait = parseInt(wait, 10);
// Remove debouncee
var index = findItem(target, method, this._debouncees);
if (index > -1) {
var timerId = this._debouncees[index + 3];
@@ -9823,15 +9805,15 @@
context = _debouncees$splice[0],
func = _debouncees$splice[1],
params = _debouncees$splice[2];
if (isImmediate === false) {
- _this3.run.apply(_this3, [context, func].concat(params));
+ _this3._run(context, func, params);
}
}, wait);
if (isImmediate && index === -1) {
- this.join.apply(this, [target, method].concat(args));
+ this._join(target, method, args);
}
this._debouncees.push(target, method, args, timer);
return timer;
};
@@ -9870,10 +9852,41 @@
Backburner.prototype.ensureInstance = function ensureInstance() {
this._ensureInstance();
};
+ Backburner.prototype._join = function _join(target, method, args) {
+ if (this.currentInstance === null) {
+ return this._run(target, method, args);
+ }
+ if (target === undefined && args === undefined) {
+ return method();
+ } else {
+ return method.apply(target, args);
+ }
+ };
+
+ Backburner.prototype._run = function _run(target, method, args) {
+ var onError = getOnError(this.options);
+ this.begin();
+ if (onError) {
+ try {
+ return method.apply(target, args);
+ } catch (error) {
+ onError(error);
+ } finally {
+ this.end();
+ }
+ } else {
+ try {
+ return method.apply(target, args);
+ } finally {
+ this.end();
+ }
+ }
+ };
+
Backburner.prototype._cancelAutorun = function _cancelAutorun() {
if (this._autorun !== null) {
this._platform.clearNext(this._autorun);
this._autorun = null;
}
@@ -16356,11 +16369,11 @@
@private
*/
currentWhen: (0, _emberRuntime.deprecatingAlias)('current-when', { id: 'ember-routing-view.deprecated-current-when', until: '3.0.0' }),
/**
Used to determine when this `LinkComponent` is active.
- @property currentWhen
+ @property current-when
@public
*/
'current-when': null,
/**
Sets the `title` attribute of the `LinkComponent`'s HTML element.
@@ -30643,19 +30656,23 @@
},
normalizeQueryParams: function (routeName, models, queryParams) {
(0, _emberMetal.get)(this, 'router')._prepareQueryParams(routeName, models, queryParams);
},
generateURL: function (routeName, models, queryParams) {
- var _get;
+ var router = (0, _emberMetal.get)(this, 'router');
+ // return early when the router microlib is not present, which is the case for {{link-to}} in integration tests
+ if (!router._routerMicrolib) {
+ return;
+ }
var visibleQueryParams = {};
if (queryParams) {
(0, _emberUtils.assign)(visibleQueryParams, queryParams);
this.normalizeQueryParams(routeName, models, visibleQueryParams);
}
- return (_get = (0, _emberMetal.get)(this, 'router')).generate.apply(_get, [routeName].concat(models, [{ queryParams: visibleQueryParams }]));
+ return router.generate.apply(router, [routeName].concat(models, [{ queryParams: visibleQueryParams }]));
},
isActiveForRoute: function (contexts, queryParams, routeName, routerState, isCurrentWhenSpecified) {
var router = (0, _emberMetal.get)(this, 'router');
var handlers = router._routerMicrolib.recognizer.handlersFor(routeName);
@@ -36652,11 +36669,13 @@
@namespace Ember
@static
@public
*/
function inject() {
- (true && !(false) && (0, _emberDebug.assert)('Injected properties must be created through helpers, see \'' + Object.keys(inject).join('"', '"') + '\''));
+ (true && !(false) && (0, _emberDebug.assert)('Injected properties must be created through helpers, see \'' + Object.keys(inject).map(function (k) {
+ return '\'inject.' + k + '\'';
+ }).join(' or ') + '\''));
}
// Dictionary of injection validations by type, added to by `createInjectionHelper`
var typeValidators = {};
@@ -47670,10 +47689,10 @@
*/
});
enifed("ember/version", ["exports"], function (exports) {
"use strict";
- exports.default = "2.18.0-beta.1";
+ exports.default = "2.18.0-beta.2";
});
enifed("handlebars", ["exports"], function (exports) {
"use strict";
// File ignored in coverage tests via setting in .istanbul.yml