-
- if ( !currVar.prototype || util.isEmptyObject( currVar.prototype ) ) {
-
- if ( action === CompletenessTest.ACTION_INJECT ) {
-
- that.injectionTracker[ currPathArray.join( '.' ) ] = true;
- that.injectCheck( masterVariable, currPathArray, function () {
- that.methodCallTracker[ currPathArray.join( '.' ) ] = true;
- } );
- }
-
- // We don't support checking object constructors yet...
- // ...we can check the prototypes fine, though.
- } else {
- if ( action === CompletenessTest.ACTION_INJECT ) {
-
- for ( key in currVar.prototype ) {
- if ( hasOwn.call( currVar.prototype, key ) ) {
- value = currVar.prototype[key];
- if ( key === 'constructor' ) {
- continue;
- }
-
- that.walkTheObject( key, value, masterVariable, currPathArray.concat( 'prototype' ), action );
- }
- }
-
- }
+ // Don't put a spy in constructor functions as it messes with
+ // instanceof etc.
+ if ( !currVal.prototype || util.isEmptyObject( currVal.prototype ) ) {
+ this.injectionTracker[ currPathArray.join( '.' ) ] = true;
+ this.injectCheck( currObj, currName, function () {
+ ct.methodCallTracker[ currPathArray.join( '.' ) ] = true;
+ } );