pastojs: typecast string(unicodestring), unicodestring(string)

git-svn-id: trunk@41224 -
This commit is contained in:
Mattias Gaertner 2019-02-04 16:02:42 +00:00
parent cfe65c8cd8
commit bf1af93938
2 changed files with 12 additions and 4 deletions

View File

@ -1183,8 +1183,8 @@ const
]; ];
bfAllJSBaseProcs = bfAllStandardProcs; bfAllJSBaseProcs = bfAllStandardProcs;
btAllJSStrings = [btString]; btAllJSStrings = [btString,btUnicodeString];
btAllJSChars = [btChar]; btAllJSChars = [btChar,btWideChar];
btAllJSStringAndChars = btAllJSStrings+btAllJSChars; btAllJSStringAndChars = btAllJSStrings+btAllJSChars;
btAllJSFloats = [btDouble]; btAllJSFloats = [btDouble];
btAllJSBooleans = [btBoolean]; btAllJSBooleans = [btBoolean];

View File

@ -6679,6 +6679,10 @@ begin
'{$H+}', '{$H+}',
'const', 'const',
' a = #$00F3#$017C;', // first <256, then >=256 ' a = #$00F3#$017C;', // first <256, then >=256
' b = string(''a'');',
' c = string(''ä'');',
' d = UnicodeString(''b'');',
' e = UnicodeString(''ö'');',
'var', 'var',
' s: string = ''abc'';', ' s: string = ''abc'';',
'begin', 'begin',
@ -6699,8 +6703,12 @@ begin
CheckSource('TestStringConst', CheckSource('TestStringConst',
LinesToStr([ LinesToStr([
'this.a = "óż";', 'this.a = "óż";',
'this.s="abc";' 'this.b = "a";',
]), 'this.c = "ä";',
'this.d = "b";',
'this.e = "ö";',
'this.s="abc";',
'']),
LinesToStr([ LinesToStr([
'$mod.s="";', '$mod.s="";',
'$mod.s="\r\n";', '$mod.s="\r\n";',