I trying to use scriptside RTTI to implement ORM for my webscripts. I have
manually added RTTI to the DWSWebServer.
So the following code works:
<html>
<head>
<title>Hello DWS</title>
</head>
<body>
<?pas
type
Test = Class
published
Field : integer;
procedure Blub(); begin end;
end;
var rtti := RTTIRawAttributes;
for var i := low(rtti) to high(rtti) do
begin
println(rtti[i].T.Name);
if rtti[i].A is RTTIPropertyAttribute
then
println(RTTIPropertyAttribute(rtti[i].A).Name)
else if rtti[i].A is RTTIMethodAttribute then
println(RTTIMethodAttribute(rtti[i].A).Name);
end;
?>
</body>
</html>
But if I add a uses clause e.g. uses Utils (Utils is only a blank file with
unit Utils header), i will geht a Null Pointer Exception:
Runtime Error: Access violation at address 0052E624 in module
'DWSWebServer.exe'. Read of address 00000000 in RTTIRawAttributes [line: 16,
column: 17]
Code with uses:
<html>
<head>
<title>Hello DWS</title>
</head>
<body>
<?pas
uses Utils;
type
Test = Class
published
Field : integer;
procedure Blub(); begin end;
end;
var rtti := RTTIRawAttributes;
for var i := low(rtti) to high(rtti) do
begin
println(rtti[i].T.Name);
if rtti[i].A is RTTIPropertyAttribute
then
println(RTTIPropertyAttribute(rtti[i].A).Name)
else if rtti[i].A is RTTIMethodAttribute then
println(RTTIMethodAttribute(rtti[i].A).Name);
end;
?>
</body>
</html>
Original issue reported on code.google.com by dragonfl...@gmail.com on 20 Jul 2014 at 12:44
Original issue reported on code.google.com by
dragonfl...@gmail.com
on 20 Jul 2014 at 12:44