View Issue Details

IDProjectCategoryView StatusLast Update
0038776pas2jsrtlpublic2021-04-19 22:41
Reporterhenrique Assigned ToMattias Gaertner  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformPas2JsOSWindows 
Summary0038776: TValue problem
DescriptionI had a problem with TValue, that when it was empty FData would be as undefined.
But this creates a problem in a JSON serializer that I'm doing, that stringfy removes the properties as undefined.
With this I made an adjustment in the Empty function of TValue, to start FData with the null value, then everything works as expected.
TagsNo tags attached.
Fixed in Revision1164.
Attached Files

Activities

henrique

2021-04-19 19:05

reporter  

0001-Preenchido-o-campo-FData-com-nulo.patch (591 bytes)   
From c27ed2f9462d014ecceb9920d63192aec338d707 Mon Sep 17 00:00:00 2001
From: Henrique Gottardi Werlang <henriquewerlang@hotmail.com>
Date: Mon, 19 Apr 2021 11:55:43 -0300
Subject: [PATCH] Preenchido o campo FData com nulo.

---
 packages/rtl/rtti.pas | 1 +
 1 file changed, 1 insertion(+)

diff --git a/packages/rtl/rtti.pas b/packages/rtl/rtti.pas
index 9324407e..e35dda9e 100644
--- a/packages/rtl/rtti.pas
+++ b/packages/rtl/rtti.pas
@@ -822,6 +822,7 @@ end;
 
 class function TValue.Empty: TValue;
 begin
+  Result.FData := nil;
   Result.FTypeInfo := nil;
 end;
 
-- 
2.31.1.windows.1

Mattias Gaertner

2021-04-19 22:41

manager   ~0130458

Thanks!

Issue History

Date Modified Username Field Change
2021-04-19 19:05 henrique New Issue
2021-04-19 19:05 henrique File Added: 0001-Preenchido-o-campo-FData-com-nulo.patch
2021-04-19 22:38 Mattias Gaertner Assigned To => Mattias Gaertner
2021-04-19 22:38 Mattias Gaertner Status new => assigned
2021-04-19 22:41 Mattias Gaertner Status assigned => resolved
2021-04-19 22:41 Mattias Gaertner Resolution open => fixed
2021-04-19 22:41 Mattias Gaertner Fixed in Revision => 1164.
2021-04-19 22:41 Mattias Gaertner Note Added: 0130458