Skip to content

Commit a80b277

Browse files
author
filt3rek
committed
Std.is to Std.isOfType in Manager.hx and getter/setter macro path in RecordMacros.hx fix
1 parent aa7703f commit a80b277

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

src/sys/db/Manager.hx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,8 @@ class Manager<T : Object> {
358358
if (info != null)
359359
{
360360
if (val != null) switch (info.t) {
361-
case DDate, DDateTime if (!Std.is(val,Date)):
362-
if (Std.is(val,Float))
361+
case DDate, DDateTime if (!Std.isOfType(val,Date)):
362+
if (Std.isOfType(val,Float))
363363
{
364364
val = Date.fromTime(val);
365365
} else {
@@ -370,27 +370,27 @@ class Manager<T : Object> {
370370
val = Date.fromString(v);
371371
}
372372
case DSmallBinary, DLongBinary, DBinary, DBytes(_), DData:
373-
if (Std.is(val, String))
373+
if (Std.isOfType(val, String))
374374
val = haxe.io.Bytes.ofString(val);
375375
#if cpp
376-
else if (Std.is(val, haxe.io.BytesData))
376+
else if (Std.isOfType(val, haxe.io.BytesData))
377377
val = haxe.io.Bytes.ofData(val);
378378
#end
379-
case DString(_) | DTinyText | DSmallText | DText if(!Std.is(val,String)):
379+
case DString(_) | DTinyText | DSmallText | DText if(!Std.isOfType(val,String)):
380380
val = val + "";
381381
#if (cs && erase_generics)
382382
// on C#, SQLite Ints are returned as Int64
383-
case DInt if (!Std.is(val,Int)):
383+
case DInt if (!Std.isOfType(val,Int)):
384384
val = cast(val,Int);
385385
#end
386-
case DBool if (!Std.is(val,Bool)):
387-
if (Std.is(val,Int))
386+
case DBool if (!Std.isOfType(val,Bool)):
387+
if (Std.isOfType(val,Int))
388388
val = val != 0;
389-
else if (Std.is(val, String)) switch (val.toLowerCase()) {
389+
else if (Std.isOfType(val, String)) switch (val.toLowerCase()) {
390390
case "1", "true": val = true;
391391
case "0", "false": val = false;
392392
}
393-
case DFloat if (Std.is(val,String)):
393+
case DFloat if (Std.isOfType(val,String)):
394394
val = Std.parseFloat(val);
395395
case _:
396396
}

src/sys/db/RecordMacros.hx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ class RecordMacros {
794794
});
795795
return { sql : { expr : ECall( { expr : EField(manager, "quoteList"), pos : p }, [e.sql, { expr : ECheckType(e2,t), pos : p } ]), pos : p }, t : DBool, n : e.n };
796796
#end
797-
case OpUShr, OpInterval, OpAssignOp(_), OpAssign, OpArrow:
797+
case OpUShr, OpInterval, OpAssignOp(_), OpAssign, OpArrow, OpNullCoal:
798798
error("Unsupported operation", p);
799799
}
800800
case EUnop(op, _, e):
@@ -1357,7 +1357,7 @@ class RecordMacros {
13571357
continue;
13581358
// generate get/set methods stubs
13591359
var pos = f.pos;
1360-
var ttype = t, tname;
1360+
var ttype = t, tname, p;
13611361
while( true )
13621362
switch(ttype) {
13631363
case TPath(t):
@@ -1368,7 +1368,7 @@ class RecordMacros {
13681368
};
13691369
continue;
13701370
}
1371-
var p = t.pack.copy();
1371+
p = t.pack.copy();
13721372
p.push(t.name);
13731373
if( t.sub != null ) p.push(t.sub);
13741374
tname = p.join(".");
@@ -1381,13 +1381,13 @@ class RecordMacros {
13811381
args : [],
13821382
params : [],
13831383
ret : t,
1384-
expr: macro return @:privateAccess $i{tname}.manager.__get(this, $v{f.name}, $v{relKey}, $v{lock}),
1384+
expr: macro return @:privateAccess $p{p}.manager.__get(this, $v{f.name}, $v{relKey}, $v{lock}),
13851385
};
13861386
var set = {
13871387
args : [{ name : "_v", opt : false, type : t, value : null }],
13881388
params : [],
13891389
ret : t,
1390-
expr: macro return @:privateAccess $i{tname}.manager.__set(this, $v{f.name}, $v{relKey}, _v),
1390+
expr: macro return @:privateAccess $p{p}.manager.__set(this, $v{f.name}, $v{relKey}, _v),
13911391
};
13921392
var meta = [{ name : ":hide", params : [], pos : pos }];
13931393
f.meta.push({ name: ":isVar", params : [], pos : pos });

0 commit comments

Comments
 (0)