Skip to content

Commit

Permalink
Merge pull request #77 from DoclerLabs/develop
Browse files Browse the repository at this point in the history
prepare 0.20.2
  • Loading branch information
aliokan authored May 15, 2017
2 parents ff8faa2 + 4a9d519 commit 9bc9e35
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
15 changes: 13 additions & 2 deletions src/hex/control/trigger/CommandTriggerBuilder.hx
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,21 @@ class CommandTriggerBuilder
switch( arg.expr )
{
case EMeta( s, _.expr => EVars( vars ) ) if ( s.name == "Inject" ):

var mapName = if ( s.params.length > 0 )
{
switch( s.params[ 0 ].expr )
{

case EConst(CString(name)): name;
case EConst(CIdent(ident)): "";
case EField(e, field): "";
case _: "";
}
} else "";

var varName = vars[0].name;
var varType = vars[0].type;
arg.expr = (macro var $varName : $varType = this.injector.getInstanceWithClassName( $v{ MacroUtil.getFQCNFromComplexType( varType ) } )).expr;
arg.expr = (macro var $varName : $varType = this.injector.getInstanceWithClassName( $v{ MacroUtil.getFQCNFromComplexType( varType ) }, $v{mapName} )).expr;

case _:
CommandTriggerBuilder._searchForInjection( arg );
Expand Down
5 changes: 2 additions & 3 deletions test/hex/module/ModuleTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import hex.di.IBasicInjector;
import hex.di.IDependencyInjector;
import hex.di.Injector;
import hex.di.error.MissingMappingException;
import hex.di.mapping.MappingDefinition;
import hex.domain.DomainExpert;
import hex.error.Exception;
import hex.error.IllegalStateException;
Expand Down Expand Up @@ -387,7 +386,7 @@ private class MockModuleForTestingRuntimeDependencies extends Module
override function _getRuntimeDependencies() : IRuntimeDependencies
{
var rd : RuntimeDependencies = new RuntimeDependencies();
rd.addMappedDependencies( [ new MappingDefinition( IService ) ]);
rd.addMappedDependencies([ {type: IService } ]);
return rd;
}
}
Expand Down Expand Up @@ -486,4 +485,4 @@ private class MockService implements IService
{

}
}
}

0 comments on commit 9bc9e35

Please sign in to comment.