指定された値が指定されたベースオブジェクトから派生したものである場合、0 以外の数値を返します。
HasBase := HasBase(Value, BaseObj)
任意の値、任意の型。
型:Object
テストするベースオブジェクトの候補です。
This function returns 1 (true) if BaseObj is in Value's chain of base objects, otherwise 0 (false).
次のコードは、この機能とほぼ同等です:
MyHasBase(Value, BaseObj) { b := Value while b := ObjGetBase(b) if b = BaseObj return true return false }
For example, HasBase(Obj, Array.Prototype)
is true if Obj is an instance of Array or any derived class. This the same check performed by Obj is Array
; however, instances can be based on other instances, whereas is
requires a Class.
HasBaseは、オブジェクトとプリミティブな値の両方を受け入れます。例えば、HasBase(1, 0.base)
は真を返します。
Objects, Obj.Base, ObjGetBase, HasMethod, HasProp