geoffsmith82 / delphi-javascript

Automatically exported from code.google.com/p/delphi-javascript
5 stars 2 forks source link

Perhaps one more bug when using wrapper in XE2. #13

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Perhaps one more bug when using wrapper in XE2. I don’t have ability to test 
it under different version of Delphi.

File: “JSINTF.PAS”

procedure TJSClassProto.DefineJSClass(AClass: TClass; AClassFlags: 
TJSClassFlagAttributes);

From
{
    if exclude or (Length(ip.ReadMethod.GetParameters) = 0) or (ip.Visibility < mvPublic) then
      continue;
}
To
{
    if exclude or (ip.ReadMethod = nil) or (Length(ip.ReadMethod.GetParameters) = 0) or (ip.Visibility < mvPublic) then
      continue;
}

Sometimes, for some method, for example for some “Destroy” method 
ip.ReadMethod is nil, therefor calling ip.ReadMethod.GetParameters cause

---------------------------
Debugger Exception Notification
---------------------------
Project XXXXXXXXXX.exe raised exception class $C0000005 with message 'access 
violation at 0x0440b9d3: read of address 0x00000000'.
---------------------------
Break   Continue   Help   
---------------------------

Original issue reported on code.google.com by andre...@diatomenterprises.com on 29 Nov 2013 at 7:56

Attachments:

GoogleCodeExporter commented 8 years ago
Fixed, but this looks like xe2 rtti  bug, returning destroy method as an a 
method for indexed properties dosen't make sense @ all

Original comment by n.ame...@gmail.com on 29 Nov 2013 at 9:54