File:  [parser3project] / parser3 / tests / 410.html
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Mon Jan 4 22:28:28 2021 UTC (5 years, 4 months ago) by moko
Branches: MAIN
CVS tags: release_3_5_1, release_3_5_0, release_3_4_6, HEAD
test for $CLASS-GETTER-PROTECTED(false) added

@main[]

# 4objects (default behavour)

$object[^object::create[]]

# getter will be called and the result will be cached
o1: $object.field
# without getter call, cached result will be returned
o2: $object.field
o3: $object.field

calls count: $object.cnt

# 4class, not default as getter will be deleted from class
# use $CLASS-GETTER-PROTECTED(false) to allow it.

# getter will be called and the result will be cached
c1: $self.field
# without getter call, cached result will be returned
c2: $self.field
c3: $self.field

calls count: $self.cnt

@GET_field[]
$result[some code result]
$self.field[$result]
$self.cnt($self.cnt+1)


@CLASS
object

@create[]

@GET_field[]
$result[some code result]
$self.field[$result]
$self.cnt($self.cnt+1)

E-mail: