minor updates

This commit is contained in:
Dima Granetchi
2014-11-28 18:37:36 +02:00
parent 43ca5cd580
commit b1bcd3b034
5 changed files with 12 additions and 12 deletions
+4 -5
View File
@@ -85,9 +85,9 @@ class BindSignalProvider implements IBindingSignalProvider {
var args = switch (field.kind) {
case FMethod(_):
if (!isNull(oldValue))
Context.error("method notify don't require oldValue", oldValue.pos);
Context.error("method notify doesn't require oldValue", oldValue.pos);
if (!isNull(newValue))
Context.error("method notify don't require newValue", newValue.pos);
Context.error("method notify doesn't require newValue", newValue.pos);
[];
case FVar(_, _):
[oldValue, newValue];
@@ -132,9 +132,8 @@ class BindSignalProvider implements IBindingSignalProvider {
});
var getter = macro function foo() {
if (this.$signalPrivateName == null) {
this.$signalPrivateName = ${builder}
}
if (this.$signalPrivateName == null)
this.$signalPrivateName = ${builder};
return $i{signalPrivateName};
};
var getterAccess = [APrivate];
+2 -2
View File
@@ -26,8 +26,8 @@ typedef Chain = {
var expr:Expr;
var zeroName:String;
}
#end
@:access(bindx.BindMacros)
class BindExt {
@@ -307,7 +307,7 @@ class BindExt {
}
if (zeroListener == null || zeroListener.f.bindable == false)
throw new bindx.Error("Chain is not bindable.", expr.pos);
throw new bindx.Error('${expr.toString()} is not bindable.', expr.pos);
var zeroName = res.zeroName = zeroListener.f.e.toString();
if (zeroName != "this")
+4 -1
View File
@@ -1,5 +1,7 @@
package bindx;
#if macro
import haxe.macro.Context;
import haxe.macro.Expr.Position;
@@ -44,4 +46,5 @@ class Error {
public function contextFatal():Void {
Context.fatalError(message, pos);
}
}
}
#end
-2
View File
@@ -15,7 +15,5 @@ interface IBindingSignalProvider {
function getClassFieldUnbindExpr(expr:Expr, field:ClassField, listener:Expr):Expr;
function getClassFieldChangedExpr(expr:Expr, field:ClassField, oldValue:Expr, newValue:Expr):Expr;
function getUnbindAllExpr(expr:ExprOf<IBindable>, type:Type):Expr;
}
#end
+2 -2
View File
@@ -13,9 +13,9 @@ class MetaUtils {
static public inline var BINDABLE_META = ":bindable";
static public function findParam(meta:MetadataEntry, name:String):Expr {
if (meta.params == null) {
if (meta.params == null)
return null;
}
for (p in meta.params) {
switch (p.expr) {
case EBinop(OpAssign, e1, e2):