Keep all Promise implementation details internal

This commit is contained in:
Elliot Nelson
2019-05-08 09:07:01 -04:00
parent 95e1890e64
commit 4731b4ee4d
9 changed files with 107 additions and 102 deletions

View File

@@ -13,7 +13,7 @@ getJasmineRequireObj().Spy = function (j$) {
* @constructor
* @name Spy
*/
function Spy(name, originalFn, customStrategies) {
function Spy(name, originalFn, customStrategies, getPromise) {
var numArgs = (typeof originalFn === 'function' ? originalFn.length : 0),
wrapper = makeFunc(numArgs, function () {
return spy.apply(this, Array.prototype.slice.call(arguments));
@@ -24,7 +24,8 @@ getJasmineRequireObj().Spy = function (j$) {
getSpy: function () {
return wrapper;
},
customStrategies: customStrategies
customStrategies: customStrategies,
getPromise: getPromise
}),
callTracker = new j$.CallTracker(),
spy = function () {
@@ -98,7 +99,6 @@ getJasmineRequireObj().Spy = function (j$) {
return wrapper;
}
function SpyStrategyDispatcher(strategyArgs) {
var baseStrategy = new j$.SpyStrategy(strategyArgs);
var argsStrategies = new StrategyDict(function() {