Skip to content

Commit

Permalink
TESTBOX-222 #resolve
Browse files Browse the repository at this point in the history
Heap issues and stack overflow issues when normalizing ORM entities in mocking arguments
  • Loading branch information
lmajano committed Apr 20, 2018
1 parent dd88b07 commit 989ea71
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions system/MockBox.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -298,17 +298,17 @@ Description :
<cfscript>
if( len( this._mockCurrentMethod ) ){
var args = arguments;
return this.$callback( function(){
return this.$callback( function(){
throw(
type = structKeyExists( args, "type" ) ? args.type : "",
message = structKeyExists( args, "message" ) ? args.message : "",
detail = structKeyExists( args, "detail" ) ? args.detail : "",
errorCode = structKeyExists( args, "errorCode" ) ? args.errorCode : "0"
);
);
} );
}

throw(
throw(
type = "MockFactory.IllegalStateException",
message = "No current method name set",
detail = "This method was probably called without chaining it to a $() call. Ex: obj.$().$throws(), or obj.$('method').$args().$throws()"
Expand Down Expand Up @@ -536,7 +536,7 @@ Description :
}
else if( isObject( argOrderedTree[ arg ] ) and isInstanceOf( argOrderedTree[ arg ], "Component" ) ){
// If an object and CFC, just use serializeJSON
serializedArgs &= serializeJSON( argOrderedTree[ arg ] );
serializedArgs &= serializeJSON( getMetadata( argOrderedTree[ arg ] ) );
}
else{
// Get obj rep
Expand Down

0 comments on commit 989ea71

Please sign in to comment.