@@ -205,28 +205,12 @@ jasmine.Expectation.prototype.wrapCompare = function(name, matcherFactory) {
205
205
206
206
matchError . stack = matchError . stack . replace ( / + a t .+ j a s m i n e w d .+ \n / , '' ) ;
207
207
208
- var actualValue = null ;
209
- var expectedValue = null ;
210
-
211
- // Check to see if the value is of type webdriver.promise.Deferred
212
- // since deferred is not a promise.
213
- if ( expectation . actual instanceof webdriver . promise . Deferred ) {
214
- actualValue = expectation . actual . promise ;
215
- } else {
216
- actualValue = expectation . actual ;
217
- }
218
- if ( expected instanceof webdriver . promise . Deferred ) {
219
- expectedValue = expected . promise ;
220
- } else {
221
- expectedValue = expected ;
222
- }
223
-
224
- if ( ! webdriver . promise . isPromise ( actualValue ) &&
225
- ! webdriver . promise . isPromise ( expectedValue ) ) {
226
- compare ( actualValue , expectedValue ) ;
208
+ if ( ! webdriver . promise . isPromise ( expectation . actual ) &&
209
+ ! webdriver . promise . isPromise ( expected ) ) {
210
+ compare ( expectation . actual , expected ) ;
227
211
} else {
228
- webdriver . promise . when ( actualValue ) . then ( function ( actual ) {
229
- return webdriver . promise . all ( expectedValue ) . then ( function ( expected ) {
212
+ webdriver . promise . when ( expectation . actual ) . then ( function ( actual ) {
213
+ return webdriver . promise . all ( expected ) . then ( function ( expected ) {
230
214
return compare ( actual , expected ) ;
231
215
} ) ;
232
216
} ) ;
0 commit comments