Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated message on Map.IMap typedef and more... #58

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/mockatoo/internal/MockMethod.hx
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,11 @@ class MockMethod
if (value == null) return false;

// Please note, we cannot check HashMap because it is an abstract, and does not have an iterator function at runtime.
#if (haxe_ver >= 3.2)
if (Std.is(value, Array) || Std.is(value, haxe.Constraints.IMap)) return true;
#else
if (Std.is(value, Array) || Std.is(value, Map.IMap)) return true;
#end

//Iterable
var iterator = Reflect.field(value, "iterator");
Expand Down
2 changes: 2 additions & 0 deletions src/mockatoo/macro/ClassFields.hx
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ class ClassFields
return TEnum(t, mapTypes(params,map));
case TType(t, params):
return TType(t, mapTypes(params,map));
case TFun(args, ret):
return TFun([ for (arg in args) { t: mapType(arg.t, map), opt: arg.opt, name: arg.name } ], mapType(ret, map));
default:
return type;
}
Expand Down
6 changes: 3 additions & 3 deletions src/mockatoo/macro/MockMaker.hx
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ class MockMaker
case $eCaseThrows: throw v;
case $eCaseCalls:
var args:Array<Dynamic> = $eArgs;
return v(args);
return cast Reflect.callMethod(null, v, args);
case $eCaseStubs: return $eDefaultReturnValue;
case $eCaseReal: return $eSuper;
case $eCaseNone: return $eIf;
Expand All @@ -835,7 +835,7 @@ class MockMaker
case $eCaseThrows: throw v;
case $eCaseCalls:
var args:Array<Dynamic> = $eArgs;
return v(args);
return cast Reflect.callMethod(null, v, args);
case $eCaseStubs: return $eReturn;
case $eCaseReal: return $eSuper;
default: return $eIf;
Expand All @@ -855,7 +855,7 @@ class MockMaker
case $eCaseThrows: throw v;
case $eCaseCalls:
var args:Array<Dynamic> = $eArgs;
v(args);
return cast Reflect.callMethod(null, v, args);
case $eCaseStubs: $eNull;
case $eCaseReal: $eSuper;
default: $eIf;
Expand Down