blib/lib/Text/Nunjucks/Runtime/None.pm

filter: Statementstmt 100% 10 / 10 Branchbran n/a Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 100% 3 / 3 Podpod 0.0% 0 / 1 totaltotal 94.1% 16 / 17 CC 2 SCAR 4.1
CC
2
Cov
100%
instance
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.5
« blib/lib/Text/Nunjucks/Parser.pm ↑ Summary blib/lib/Text/Nunjucks/Lexer/Token.pm »
1 package Text::Nunjucks::Runtime::None;
2 # ABSTRACT: The JS null sentinel (ADR 0006)
3  
4 23 our $VERSION = '0.001';
5  
6 23 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 23 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 # A port addition to runtime.js, at its ADR-designated home beside
10 # Text::Nunjucks::Runtime, which hands it out as Text::Nunjucks::Runtime->None.
11 #
12 # A single immutable process-wide sentinel standing for JS `null`. Perl
13 # `undef` is JS `undefined`; a present-but-null value is this object, so the
14 # null/undefined distinction (is defined / is none / is undefined,
15 # throwOnUndefined) survives set/macros/filters where an exists-check cannot.
16 # No stringification/bool overload on purpose: every output/compare/lookup
17 # path routes None through suppress_value / op_* / member_lookup, so a raw
18 # None that leaked into bare Perl concat should stay visible, not silently ''.
19  
20 23 my $INSTANCE;
21 567 ▶sub instance { $INSTANCE //= bless \( my $x ), __PACKAGE__ }
Subroutine instance: called CC=2 SCAR=6.9
Pod undocumented
Condition100%2/2
$INSTANCE //= bless(\my $x, __PACKAGE__)
l!l
5589
MC/DC100%1/1
$INSTANCE //= bless(\my $x, __PACKAGE__)
$INSTANCE
Truth table100%2/2
A
A= $INSTANCE
Aresult
11
00
22  
23 23 1;
24  
25 __END__
« blib/lib/Text/Nunjucks/Parser.pm ↑ Summary blib/lib/Text/Nunjucks/Lexer/Token.pm »