line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyright 2015 - present MongoDB, Inc. |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); |
4
|
|
|
|
|
|
|
# you may not use this file except in compliance with the License. |
5
|
|
|
|
|
|
|
# You may obtain a copy of the License at |
6
|
|
|
|
|
|
|
# |
7
|
|
|
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0 |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
# Unless required by applicable law or agreed to in writing, software |
10
|
|
|
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS, |
11
|
|
|
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12
|
|
|
|
|
|
|
# See the License for the specific language governing permissions and |
13
|
|
|
|
|
|
|
# limitations under the License. |
14
|
|
|
|
|
|
|
|
15
|
61
|
|
|
61
|
|
533630
|
use strict; |
|
61
|
|
|
|
|
150
|
|
|
61
|
|
|
|
|
1710
|
|
16
|
61
|
|
|
61
|
|
322
|
use warnings; |
|
61
|
|
|
|
|
119
|
|
|
61
|
|
|
|
|
2441
|
|
17
|
|
|
|
|
|
|
package MongoDB::Role::_PrivateConstructor; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# MongoDB interface for a private constructor |
20
|
|
|
|
|
|
|
|
21
|
61
|
|
|
61
|
|
311
|
use version; |
|
61
|
|
|
|
|
114
|
|
|
61
|
|
|
|
|
441
|
|
22
|
|
|
|
|
|
|
our $VERSION = 'v2.2.2'; |
23
|
|
|
|
|
|
|
|
24
|
61
|
|
|
61
|
|
4966
|
use MongoDB::_Constants; |
|
61
|
|
|
|
|
141
|
|
|
61
|
|
|
|
|
7139
|
|
25
|
61
|
|
|
61
|
|
374
|
use Sub::Defer; |
|
61
|
|
|
|
|
121
|
|
|
61
|
|
|
|
|
2909
|
|
26
|
|
|
|
|
|
|
|
27
|
61
|
|
|
61
|
|
368
|
use Moo::Role; |
|
61
|
|
|
|
|
148
|
|
|
61
|
|
|
|
|
364
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# When assertions are enabled, the private constructor delegates to the |
30
|
|
|
|
|
|
|
# public one, which checks required/isa assertions. When disabled, |
31
|
|
|
|
|
|
|
# the private constructor blesses args directly to the class for speed. |
32
|
|
|
|
|
|
|
BEGIN { |
33
|
61
|
|
|
61
|
|
22638
|
my $NO_ASSERT_CONSTRUCTOR = <<'HERE'; |
34
|
|
|
|
|
|
|
my %done; |
35
|
|
|
|
|
|
|
sub _new { |
36
|
|
|
|
|
|
|
my $class = shift; |
37
|
|
|
|
|
|
|
undefer_sub($class->can(q{new})) and $done{$class}++ |
38
|
|
|
|
|
|
|
unless $done{$class}; |
39
|
|
|
|
|
|
|
return bless {@_}, $class |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
HERE |
42
|
|
|
|
|
|
|
|
43
|
61
|
0
|
0
|
0
|
|
7252
|
WITH_ASSERTS |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
? eval 'sub _new { my $class = shift; $class->new(@_) }' ## no critic |
45
|
|
|
|
|
|
|
: eval $NO_ASSERT_CONSTRUCTOR; ## no critic |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |