dist/ember.prod.js in ember-source-2.18.0.beta.1 vs dist/ember.prod.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
@@ -9593,21 +9593,24 @@
l;
var queue = this._queue;
var guid = this.guidForTarget(target);
var targetQueue = guid ? this.targetQueues[guid] : undefined;
+ var index = void 0;
if (targetQueue !== undefined) {
t = void 0;
for (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
@@ -9674,20 +9677,20 @@
this.targetQueues[guid] = [method, this._queue.push(target, method, args, stack) - 4];
}
};
Queue.prototype.invoke = function (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 (target, method, args, onError, errorRecordedForStack) {
try {
- if (args && args.length > 0) {
+ if (args !== undefined) {
method.apply(target, args);
} else {
method.call(target);
}
} catch (error) {
@@ -9941,47 +9944,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 () {
- 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 () {
return this.schedule.apply(this, arguments);
};
@@ -10123,30 +10099,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;
};
@@ -10169,10 +10148,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) {
timerId = this._debouncees[index + 3];
@@ -10187,15 +10169,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;
};
@@ -10236,10 +10218,41 @@
Backburner.prototype.ensureInstance = function () {
this._ensureInstance();
};
+ Backburner.prototype._join = function (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 (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 () {
if (this._autorun !== null) {
this._platform.clearNext(this._autorun);
this._autorun = null;
}
@@ -15980,11 +15993,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.
@@ -29718,19 +29731,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);
@@ -35917,11 +35934,13 @@
@namespace Ember
@static
@public
*/
function inject() {
- false && !false && (0, _emberDebug.assert)('Injected properties must be created through helpers, see \'' + Object.keys(inject).join('"', '"') + '\'');
+ false && !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 = {};
});
@@ -43805,10 +43824,10 @@
*/
});
enifed("ember/version", ["exports"], function (exports) {
"use strict";
- exports.default = "2.18.0-beta.1";
+ exports.default = "2.18.0-beta.2";
});
/*global enifed */
enifed('node-module', ['exports'], function(_exports) {
var IS_NODE = typeof module === 'object' && typeof module.require === 'function';
if (IS_NODE) {