pastojs: fixed ord(widechar)

git-svn-id: trunk@47408 -
This commit is contained in:
Mattias Gaertner 2020-11-13 10:31:01 +00:00
parent bd8362dfce
commit fb87b423fe
2 changed files with 5 additions and 3 deletions

View File

@ -13068,7 +13068,7 @@ begin
bt:=ParamResolved.BaseType;
if bt=btRange then
bt:=ParamResolved.SubType;
if bt=btChar then
if bt in [btChar,btWideChar] then
begin
if Param is TParamsExpr then
begin

View File

@ -294,7 +294,7 @@ type
Procedure TestBaseType_RawByteStringFail;
Procedure TestTypeShortstring_Fail;
Procedure TestCharSet_Custom;
Procedure TestWideChar_VarArg;
Procedure TestWideChar;
Procedure TestForCharDo;
Procedure TestForCharInDo;
@ -7924,7 +7924,7 @@ begin
'']));
end;
procedure TTestModule.TestWideChar_VarArg;
procedure TTestModule.TestWideChar;
begin
StartProgram(false);
Add([
@ -7942,6 +7942,7 @@ begin
' Fly(wc);',
' Run(c);',
' wc:=WideChar(w);',
' w:=ord(wc);',
'']);
ConvertProgram;
CheckSource('TestWideChar_VarArg',
@ -7974,6 +7975,7 @@ begin
' }',
'});',
'$mod.wc = String.fromCharCode($mod.w);',
'$mod.w = $mod.wc.charCodeAt();',
'',
'']));
end;