View/Edit #1:has_prop*erty

Switch to edit mode.

Name(s): has_prop*erty
1:  "object:has_property(propname)"
2:  "Find out if an object has a property matching the given propname."
3:  "Returns {location} if so, 0 if not, where location is the object or the ancestor on which the property is actually defined."
4:  prop = args[1]
5:  if (prop in $code_utils.builtin_props)
6:    return {$new_root}
7:  elseif (`property_info(this, prop) ! E_PROPNF' == E_PROPNF)
8:    return 0
9:  endif
10: what = this
11: while (valid(what))
12:   if (prop in properties(what))
13:     return {what}
14:   endif
15:   what = parent(what)
16: endwhile
17: "Impossible; show me."
18: raise(E_PROPNF)
19: "Last modified by Dax (#789) on Sat Jul 27 04:59:08 2002 MDT."

Verb arguments: this none this
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: Dax (#789)

You are not logged in.

[home | help | who | search | setup | code]