Changeset 224 for Include


Ignore:
Timestamp:
Apr 30, 2007, 3:32:05 PM (18 years ago)
Author:
dai
Message:

Object.ReferenceEqualsを修正(後日、ObjPtr形式に書き換える必要あり)。
Object.ToStringで返す文字列を型名に変更。
Objectクラスのテストケースを用意。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Include/Classes/System/Object.ab

    r214 r224  
    2626    ' 参照先が等しいか判断する
    2727    Static Function ReferenceEquals(objectA As Object, objectB As Object) As Boolean
    28         If VarPtr(objectA) = 0 /*objectA = Nothing*/ Then
    29             Return VarPtr(objectB) = 0 'objectB = Nothing
    30         ElseIf VarPtr(objectB) = 0 /*objectB = Nothing*/ Then
     28        If VarPtr( objectA ) = VarPtr( objectB) Then
     29            Return True
     30        Else
    3131            Return False
    32         Else
    33             Return GetPointer(VarPtr(objectA)) = GetPointer(VarPtr(objectA))
    3432        End If
    3533    End Function
     
    4240    ' オブジェクトに関係する文字列を返す
    4341    Virtual Function ToString() As String
    44         Return "Object"
     42        Return GetType().Name
    4543    End Function
    4644
Note: See TracChangeset for help on using the changeset viewer.