From bf1af93938d6a8ff13e39f8996f37a75dd506eb7 Mon Sep 17 00:00:00 2001 From: Mattias Gaertner Date: Mon, 4 Feb 2019 16:02:42 +0000 Subject: [PATCH] pastojs: typecast string(unicodestring), unicodestring(string) git-svn-id: trunk@41224 - --- packages/pastojs/src/fppas2js.pp | 4 ++-- packages/pastojs/tests/tcmodules.pas | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/pastojs/src/fppas2js.pp b/packages/pastojs/src/fppas2js.pp index e416865c58..5a186c6c10 100644 --- a/packages/pastojs/src/fppas2js.pp +++ b/packages/pastojs/src/fppas2js.pp @@ -1183,8 +1183,8 @@ const ]; bfAllJSBaseProcs = bfAllStandardProcs; - btAllJSStrings = [btString]; - btAllJSChars = [btChar]; + btAllJSStrings = [btString,btUnicodeString]; + btAllJSChars = [btChar,btWideChar]; btAllJSStringAndChars = btAllJSStrings+btAllJSChars; btAllJSFloats = [btDouble]; btAllJSBooleans = [btBoolean]; diff --git a/packages/pastojs/tests/tcmodules.pas b/packages/pastojs/tests/tcmodules.pas index b5b8583020..a823d0d246 100644 --- a/packages/pastojs/tests/tcmodules.pas +++ b/packages/pastojs/tests/tcmodules.pas @@ -6679,6 +6679,10 @@ begin '{$H+}', 'const', ' a = #$00F3#$017C;', // first <256, then >=256 + ' b = string(''a'');', + ' c = string(''ä'');', + ' d = UnicodeString(''b'');', + ' e = UnicodeString(''ö'');', 'var', ' s: string = ''abc'';', 'begin', @@ -6699,8 +6703,12 @@ begin CheckSource('TestStringConst', LinesToStr([ 'this.a = "óż";', - 'this.s="abc";' - ]), + 'this.b = "a";', + 'this.c = "ä";', + 'this.d = "b";', + 'this.e = "ö";', + 'this.s="abc";', + '']), LinesToStr([ '$mod.s="";', '$mod.s="\r\n";',