diff --git a/packages/pastojs/tests/tcgenerics.pas b/packages/pastojs/tests/tcgenerics.pas index 475ab9f667..e6b6022766 100644 --- a/packages/pastojs/tests/tcgenerics.pas +++ b/packages/pastojs/tests/tcgenerics.pas @@ -953,7 +953,7 @@ begin 'rtl.createClass(this, "TBird$G2", this.TObject, function () {', ' this.$init = function () {', ' $mod.TObject.$init.call(this);', - ' this.F = "";', + ' this.F = "\x00";', ' };', '}, "TBird");', 'this.w = null;', diff --git a/packages/pastojs/tests/tcmodules.pas b/packages/pastojs/tests/tcmodules.pas index 42c4d8e100..69660a1e49 100644 --- a/packages/pastojs/tests/tcmodules.pas +++ b/packages/pastojs/tests/tcmodules.pas @@ -3469,7 +3469,7 @@ begin LinesToStr([ 'this.i = 0;', 'this.s = "";', - 'this.c = "";', + 'this.c = "\x00";', 'this.b = false;', 'this.d = 0.0;', 'this.i2 = 3;', @@ -3585,7 +3585,7 @@ begin 'this.b = false;', 'this.d = 0.0;', 'this.s = "";', - 'this.c = "";', + 'this.c = "\x00";', '']), LinesToStr([ // this.$main '$mod.i = $mod.i;', @@ -3636,7 +3636,7 @@ begin 'this.b = false;', 'this.d = 0.0;', 'this.s = "";', - 'this.c = "";', + 'this.c = "\x00";', '']), LinesToStr([ // this.$main '$mod.i = $mod.i;', @@ -5016,7 +5016,7 @@ begin CheckSource('TestProc_VarParamString', LinesToStr([ // statements 'this.DoIt = function (vA,vB,vC) {', - ' var c = "";', + ' var c = "\x00";', ' vA = rtl.setCharAt(vA, 0, c);', ' vB.set(rtl.setCharAt(vB.get(), 1, c));', ' vC.set(rtl.setCharAt(vC.get(), 2, c));', @@ -7417,7 +7417,7 @@ begin 'this.LowChars = rtl.createSet(null, 97, 122);', 'this.Chars = rtl.unionSet(this.LowChars, rtl.createSet(null, 65, 90));', 'this.sc = rtl.createSet(1040, 1071);', - 'this.c = "";', + 'this.c = "\x00";', 'this.s = "";', '']), LinesToStr([ @@ -8671,7 +8671,7 @@ begin ConvertProgram; CheckSource('TestChar_Compare', LinesToStr([ - 'this.c="";', + 'this.c = "\x00";', 'this.b = false;' ]), LinesToStr([ @@ -8714,7 +8714,7 @@ begin ConvertProgram; CheckSource('TestChar_BuiltInProcs', LinesToStr([ - 'this.c = "";', + 'this.c = "\x00";', 'this.i = 0;', 'this.s = "";' ]), @@ -9005,7 +9005,7 @@ begin CheckSource('TestString_CharAt', LinesToStr([ // statements 'this.s = "";', - 'this.c = "";', + 'this.c = "\x00";', 'this.b = false;' ]), LinesToStr([ // this.$main @@ -9160,7 +9160,7 @@ begin CheckSource('TestCharSet_Custom', LinesToStr([ // statements 'this.crg = "b";', - 'this.c = "";', + 'this.c = "\x00";', 'this.crg2 = "m";', 'this.s = {};', '']), @@ -9204,8 +9204,8 @@ begin '};', 'this.Run = function (c) {', '};', - 'this.c = "";', - 'this.wc = "";', + 'this.c = "\x00";', + 'this.wc = "\x00";', 'this.w = 0;', '']), LinesToStr([ // this.$main @@ -9246,7 +9246,7 @@ begin ConvertProgram; CheckSource('TestForCharDo', LinesToStr([ // statements - 'this.c = "";']), + 'this.c = "\x00";']), LinesToStr([ // this.$main 'for (var $l = 97; $l <= 99; $l++) $mod.c = String.fromCharCode($l);', 'for (var $l1 = $mod.c.charCodeAt(); $l1 >= 97; $l1--) $mod.c = String.fromCharCode($l1);', @@ -9291,11 +9291,11 @@ begin CheckSource('TestForCharInDo', LinesToStr([ // statements 'this.Foo = "foo";', - 'this.c = "";', - 'this.c2 = "";', + 'this.c = "\x00";', + 'this.c2 = "\x00";', 'this.s = "";', 'this.a1 = [];', - 'this.a2 = rtl.arraySetLength(null, "", 3);', + 'this.a2 = rtl.arraySetLength(null, "\x00", 3);', 'this.soc = {};', 'this.socr = {};', 'this.cr = "a";', @@ -10049,8 +10049,8 @@ begin ConvertProgram; CheckSource('TestCaseOfString', LinesToStr([ // statements - 'this.s = "";', - 'this.h = "";', + 'this.s = "\x00";', + 'this.h = "\x00";', '']), LinesToStr([ // $mod.$main 'var $tmp = $mod.s;', @@ -10421,13 +10421,13 @@ begin ConvertProgram; CheckSource('TestArray_StaticChar', LinesToStr([ // statements - 'this.Arr = rtl.arraySetLength(null, "", 65536);', - 'this.Arr2 = rtl.arraySetLength(null, "", 26);', + 'this.Arr = rtl.arraySetLength(null, "\x00", 65536);', + 'this.Arr2 = rtl.arraySetLength(null, "\x00", 26);', 'this.Arr3 = ["p", "a", "s"];', 'this.Arr4 = ["p", "a", "s"];', 'this.Arr5 = ["ä", "ö"];', 'this.Arr6 = ["ä", "ö"];', - 'this.c = "";', + 'this.c = "\x00";', 'this.b = false;', '']), LinesToStr([ // $mod.$main @@ -11279,7 +11279,7 @@ begin ConvertProgram; CheckSource('TestArray_ArrayOfCharAssignString', LinesToStr([ // statements - 'this.c = "";', + 'this.c = "\x00";', 'this.s = "";', 'this.a = [];', 'this.Run = function (a) {', @@ -29870,7 +29870,7 @@ begin 'this.s = "";', 'this.b = false;', 'this.d = 0.0;', - 'this.c = "";', + 'this.c = "\x00";', '']), LinesToStr([ // $mod.$main '$mod.i = rtl.trunc($mod.v);', @@ -29984,7 +29984,7 @@ begin 'this.s = "";', 'this.b = false;', 'this.d = 0.0;', - 'this.c = "";', + 'this.c = "\x00";', 'this.m = undefined;', '']), LinesToStr([ // $mod.$main @@ -30369,7 +30369,7 @@ begin 'this.b = false;', 'this.d = 0.0;', 'this.s = "";', - 'this.c = "";', + 'this.c = "\x00";', '']), LinesToStr([ // $mod.$main '$mod.v = $mod.DoIt($mod.v, $mod.v, {', @@ -30935,7 +30935,7 @@ begin 'this.DoIt$1 = function (v) {', '};', 'this.s = "";', - 'this.c = "";', + 'this.c = "\x00";', 'this.u = "";', '']), LinesToStr([ // $mod.$main @@ -30971,7 +30971,7 @@ begin 'this.DoIt$1 = function (v) {', '};', 'this.s = "";', - 'this.c = "";', + 'this.c = "\x00";', 'this.u = "";', '']), LinesToStr([ // $mod.$main @@ -31599,7 +31599,7 @@ begin ' this.$init = function () {', ' this.FPropA = "";', ' this.VarLI = 0;', - ' this.VarC = "";', + ' this.VarC = "\x00";', ' this.VarS = "";', ' this.VarD = 0.0;', ' this.VarB = false;', @@ -33631,7 +33631,7 @@ begin LinesToStr([ // statements 'this.Bar = "bar";', 'this.s = "";', - 'this.c = "";', + 'this.c = "\x00";', '$mod.$resourcestrings = {', ' Red: {', ' org: "red"', @@ -34546,7 +34546,7 @@ begin ' var ArrChar = rtl.arraySetLength(null, 0, 10);', ' var ArrByteChar = rtl.arraySetLength(null, 0, 256, 10);', ' var i = 0;', - ' var c = "";', + ' var c = "\x00";', ' var o = null;', ' i = rtl.rc(Arr[1], 1, 10);', ' i = rtl.rc(ArrByteChar[1][2], 1, 10);', @@ -34663,7 +34663,7 @@ begin 'this.DoIt = function (h) {', ' var s = "";', ' var i = 0;', - ' var c = "";', + ' var c = "\x00";', ' var o = null;', ' c = rtl.rcc(rtl.rcCharAt(s, 0), 0, 65535);', ' s = rtl.rcSetCharAt(s, i - 1, rtl.rcCharAt(s, i - 1));',