minor updates
This commit is contained in:
@@ -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];
|
||||
|
||||
@@ -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
@@ -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
|
||||
@@ -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
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user