Filename | /usr/local/src/github.com/foswiki/core/lib/Foswiki/If/OP_isweb.pm |
Statements | Executed 10 statements in 377µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 34µs | 63µs | new | Foswiki::If::OP_isweb::
1 | 1 | 1 | 25µs | 32µs | BEGIN@11 | Foswiki::If::OP_isweb::
1 | 1 | 1 | 16µs | 34µs | BEGIN@12 | Foswiki::If::OP_isweb::
1 | 1 | 1 | 9µs | 9µs | BEGIN@14 | Foswiki::If::OP_isweb::
0 | 0 | 0 | 0s | 0s | evaluate | Foswiki::If::OP_isweb::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | # See bottom of file for license and copyright information | ||||
2 | |||||
3 | =begin TML | ||||
4 | |||||
5 | ---+ package Foswiki::If::OP_isweb | ||||
6 | |||||
7 | =cut | ||||
8 | |||||
9 | package Foswiki::If::OP_isweb; | ||||
10 | |||||
11 | 2 | 44µs | 2 | 40µs | # spent 32µs (25+7) within Foswiki::If::OP_isweb::BEGIN@11 which was called:
# once (25µs+7µs) by Foswiki::If::Parser::BEGIN@29 at line 11 # spent 32µs making 1 call to Foswiki::If::OP_isweb::BEGIN@11
# spent 7µs making 1 call to strict::import |
12 | 2 | 43µs | 2 | 51µs | # spent 34µs (16+17) within Foswiki::If::OP_isweb::BEGIN@12 which was called:
# once (16µs+17µs) by Foswiki::If::Parser::BEGIN@29 at line 12 # spent 34µs making 1 call to Foswiki::If::OP_isweb::BEGIN@12
# spent 18µs making 1 call to warnings::import |
13 | |||||
14 | 2 | 241µs | 1 | 9µs | # spent 9µs within Foswiki::If::OP_isweb::BEGIN@14 which was called:
# once (9µs+0s) by Foswiki::If::Parser::BEGIN@29 at line 14 # spent 9µs making 1 call to Foswiki::If::OP_isweb::BEGIN@14 |
15 | 1 | 9µs | our @ISA = ('Foswiki::Query::UnaryOP'); | ||
16 | |||||
17 | # spent 63µs (34+30) within Foswiki::If::OP_isweb::new which was called:
# once (34µs+30µs) by Foswiki::If::Parser::new at line 42 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/If/Parser.pm | ||||
18 | 1 | 2µs | my $class = shift; | ||
19 | 1 | 32µs | 1 | 30µs | return $class->SUPER::new( # spent 30µs making 1 call to Foswiki::Query::UnaryOP::new |
20 | name => 'isweb', | ||||
21 | prec => 600 | ||||
22 | ); | ||||
23 | } | ||||
24 | |||||
25 | sub evaluate { | ||||
26 | my $this = shift; | ||||
27 | my $node = shift; | ||||
28 | my $a = $node->{params}->[0]; | ||||
29 | my %domain = @_; | ||||
30 | my $session = $domain{tom}->session; | ||||
31 | throw Error::Simple( | ||||
32 | 'No context in which to evaluate "' . $a->stringify() . '"' ) | ||||
33 | unless $session; | ||||
34 | my $web = $a->_evaluate(@_) || ''; | ||||
35 | return $session->webExists($web) ? 1 : 0; | ||||
36 | } | ||||
37 | |||||
38 | 1 | 6µs | 1; | ||
39 | __END__ |