You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class MockCommand_6 extends AbstractCommand
{
@Inject("bool")
@Optional
private var bool:Bool = true;
@Inject("iint")
@Optional
private var iint:Int = 1;
override public function execute():Void
{
if (!bool || iint != 1)
{
throw Error.Custom("MockCommand_6: invalid values: " + bool + " " + iint);
}
}
}
If I inject into MockCommand_6 without having mappings for "bool" and "iint", injector makes the to be null (for js). But in my opinion they should keep their default values
The text was updated successfully, but these errors were encountered:
I think erasing the values makes more sense because you want the injector to update everything in the command and since injector doesn't have values it will inject no value.
You could of course deal with this by injecting things through setters where you can do the null check (or any check) yourself
Whoops, wrong button ^^
Anyway, a similar option to what Steve suggests would be to fallback to a default value in a getter, as that will deal with other null cases as well.
If I inject into MockCommand_6 without having mappings for "bool" and "iint", injector makes the to be null (for js). But in my opinion they should keep their default values
The text was updated successfully, but these errors were encountered: