nedich / delphi-javascript

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

Delphi XE2 and error "Insufficient RTTI available to support this operation" for TADOTable, TADOQuery.... #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
file "JSINTF.PAS"

Following methods cause exception "Insufficient RTTI available to support this 
operation" in XE2 when calling ".MethodKind".

Suggested fix/patch below. 

If you (dear developer) have more nice solution how to fix this error, please 
go ahead! :)

Thanks!

//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=-=-=-=-=-=-=-=-=-
//-=-
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=-=-=-=-=-=-=-=-=-

const
    cnstStrExcludedMethod   =
        'FilterOnBookmarks;BookmarkValid;CompareBookmarks;GetBlobFieldData;' +
        'AppendRecord;FreeBookmark;GetBookmark;GotoBookmark;InsertRecord;' +
        'SetFields;';

//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=-=-=-=-=-=-=-=-=-
//-=- Fix for XE2 and error "Insufficient RTTI available to support this 
operation" by A.Z.
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=-=-=-=-=-=-=-=-=-

{$IF CompilerVersion = 23}
    if (Pos (methodName + ';', cnstStrExcludedMethod) > 0) then
    begin
        if exclude or m.IsConstructor or m.IsDestructor or m.IsStatic or m.IsClassMethod or (m.Visibility < Visibility) then
            continue;
    end
    else
        if exclude or m.IsConstructor or m.IsDestructor or m.IsStatic or m.IsClassMethod or (not (m.MethodKind in [mkProcedure, mkFunction])) or (m.Visibility < Visibility) then
            continue;
{$ELSE}
    if exclude or m.IsConstructor or m.IsDestructor or m.IsStatic or m.IsClassMethod or (not(m.MethodKind in [mkProcedure, mkFunction])) or (m.Visibility < Visibility) then
        continue;
{$IFEND}

//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=-=-=-=-=-=-=-=-=-
//-=-
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=-=-=-=-=-=-=-=-=-

Original issue reported on code.google.com by andre...@diatomenterprises.com on 27 Nov 2013 at 9:13

Attachments:

GoogleCodeExporter commented 9 years ago
Function ”procedure TJSClassProto.DefineJSClass(AClass: TClass; AClassFlags: 
TJSClassFlagAttributes);”

Original comment by andre...@diatomenterprises.com on 27 Nov 2013 at 9:39

GoogleCodeExporter commented 9 years ago
I am lame.

Just need to change:

{$IF CompilerVersion >= 24}
    if not m.HasExtendedInfo then continue;
{$ifend}

to 

{$IF CompilerVersion >= 23}
    if not m.HasExtendedInfo then continue;
{$ifend}

I assume it will be enought.

Original comment by andre...@diatomenterprises.com on 27 Nov 2013 at 9:43

GoogleCodeExporter commented 9 years ago
fixed, as you suggested

Original comment by n.ame...@gmail.com on 28 Nov 2013 at 10:30