minor updates
This commit is contained in:
@@ -85,9 +85,9 @@ class BindSignalProvider implements IBindingSignalProvider {
|
|||||||
var args = switch (field.kind) {
|
var args = switch (field.kind) {
|
||||||
case FMethod(_):
|
case FMethod(_):
|
||||||
if (!isNull(oldValue))
|
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))
|
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(_, _):
|
case FVar(_, _):
|
||||||
[oldValue, newValue];
|
[oldValue, newValue];
|
||||||
@@ -132,9 +132,8 @@ class BindSignalProvider implements IBindingSignalProvider {
|
|||||||
});
|
});
|
||||||
|
|
||||||
var getter = macro function foo() {
|
var getter = macro function foo() {
|
||||||
if (this.$signalPrivateName == null) {
|
if (this.$signalPrivateName == null)
|
||||||
this.$signalPrivateName = ${builder}
|
this.$signalPrivateName = ${builder};
|
||||||
}
|
|
||||||
return $i{signalPrivateName};
|
return $i{signalPrivateName};
|
||||||
};
|
};
|
||||||
var getterAccess = [APrivate];
|
var getterAccess = [APrivate];
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ typedef Chain = {
|
|||||||
var expr:Expr;
|
var expr:Expr;
|
||||||
var zeroName:String;
|
var zeroName:String;
|
||||||
}
|
}
|
||||||
|
|
||||||
#end
|
#end
|
||||||
|
|
||||||
@:access(bindx.BindMacros)
|
@:access(bindx.BindMacros)
|
||||||
class BindExt {
|
class BindExt {
|
||||||
|
|
||||||
@@ -307,7 +307,7 @@ class BindExt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (zeroListener == null || zeroListener.f.bindable == false)
|
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();
|
var zeroName = res.zeroName = zeroListener.f.e.toString();
|
||||||
if (zeroName != "this")
|
if (zeroName != "this")
|
||||||
|
|||||||
+4
-1
@@ -1,5 +1,7 @@
|
|||||||
package bindx;
|
package bindx;
|
||||||
|
|
||||||
|
#if macro
|
||||||
|
|
||||||
import haxe.macro.Context;
|
import haxe.macro.Context;
|
||||||
import haxe.macro.Expr.Position;
|
import haxe.macro.Expr.Position;
|
||||||
|
|
||||||
@@ -44,4 +46,5 @@ class Error {
|
|||||||
public function contextFatal():Void {
|
public function contextFatal():Void {
|
||||||
Context.fatalError(message, pos);
|
Context.fatalError(message, pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#end
|
||||||
@@ -15,7 +15,5 @@ interface IBindingSignalProvider {
|
|||||||
function getClassFieldUnbindExpr(expr:Expr, field:ClassField, listener:Expr):Expr;
|
function getClassFieldUnbindExpr(expr:Expr, field:ClassField, listener:Expr):Expr;
|
||||||
function getClassFieldChangedExpr(expr:Expr, field:ClassField, oldValue:Expr, newValue:Expr):Expr;
|
function getClassFieldChangedExpr(expr:Expr, field:ClassField, oldValue:Expr, newValue:Expr):Expr;
|
||||||
function getUnbindAllExpr(expr:ExprOf<IBindable>, type:Type):Expr;
|
function getUnbindAllExpr(expr:ExprOf<IBindable>, type:Type):Expr;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#end
|
#end
|
||||||
@@ -13,9 +13,9 @@ class MetaUtils {
|
|||||||
static public inline var BINDABLE_META = ":bindable";
|
static public inline var BINDABLE_META = ":bindable";
|
||||||
|
|
||||||
static public function findParam(meta:MetadataEntry, name:String):Expr {
|
static public function findParam(meta:MetadataEntry, name:String):Expr {
|
||||||
if (meta.params == null) {
|
if (meta.params == null)
|
||||||
return null;
|
return null;
|
||||||
}
|
|
||||||
for (p in meta.params) {
|
for (p in meta.params) {
|
||||||
switch (p.expr) {
|
switch (p.expr) {
|
||||||
case EBinop(OpAssign, e1, e2):
|
case EBinop(OpAssign, e1, e2):
|
||||||
|
|||||||
Reference in New Issue
Block a user