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; bt:=ParamResolved.BaseType;
if bt=btRange then if bt=btRange then
bt:=ParamResolved.SubType; bt:=ParamResolved.SubType;
if bt=btChar then if bt in [btChar,btWideChar] then
begin begin
if Param is TParamsExpr then if Param is TParamsExpr then
begin begin

View File

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