pastojs: typecast integer to widechar

git-svn-id: trunk@47407 -
This commit is contained in:
Mattias Gaertner 2020-11-13 10:22:45 +00:00
parent 5c161e8542
commit bd8362dfce
2 changed files with 6 additions and 2 deletions

View File

@ -12305,9 +12305,9 @@ begin
end;
end;
end
else if to_bt=btChar then
else if to_bt in [btChar,btWideChar] then
begin
if from_bt=btChar then
if from_bt in [btChar,btWideChar] then
begin
// char to char
Result:=ConvertExpression(Param,AContext);

View File

@ -7937,9 +7937,11 @@ begin
'var',
' c: char;',
' wc: widechar;',
' w: word;',
'begin',
' Fly(wc);',
' Run(c);',
' wc:=WideChar(w);',
'']);
ConvertProgram;
CheckSource('TestWideChar_VarArg',
@ -7950,6 +7952,7 @@ begin
'};',
'this.c = "";',
'this.wc = "";',
'this.w = 0;',
'']),
LinesToStr([ // this.$main
'$mod.Fly({',
@ -7970,6 +7973,7 @@ begin
' this.p.c = v;',
' }',
'});',
'$mod.wc = String.fromCharCode($mod.w);',
'',
'']));
end;