File tree 1 file changed +3
-4
lines changed
1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -2125,7 +2125,7 @@ if(window.jasmine || window.mocha) {
2125
2125
window . inject = angular . mock . inject = function ( ) {
2126
2126
var blockFns = Array . prototype . slice . call ( arguments , 0 ) ;
2127
2127
var errorForStack = new Error ( 'Declaration Location' ) ;
2128
- return isSpecRunning ( ) ? workFn . call ( currentSpec ) : workFn ;
2128
+ return isSpecRunning ( ) ? workFn ( ) : workFn ;
2129
2129
/////////////////////
2130
2130
function workFn ( ) {
2131
2131
var modules = currentSpec . $modules || [ ] ;
@@ -2138,9 +2138,8 @@ if(window.jasmine || window.mocha) {
2138
2138
}
2139
2139
for ( var i = 0 , ii = blockFns . length ; i < ii ; i ++ ) {
2140
2140
try {
2141
- /* jshint -W040 */ /* Jasmine explicitly provides a `this` object when calling functions */
2142
- injector . invoke ( blockFns [ i ] || angular . noop , this ) ;
2143
- /* jshint +W040 */
2141
+ // jasmine sets this to be the current spec, so we are mimicing that
2142
+ injector . invoke ( blockFns [ i ] || angular . noop , currentSpec ) ;
2144
2143
} catch ( e ) {
2145
2144
if ( e . stack && errorForStack ) {
2146
2145
throw new ErrorAddingDeclarationLocationStack ( e , errorForStack ) ;
You can’t perform that action at this time.
0 commit comments