1 |
|
|
#include "node_external_reference.h" |
2 |
|
|
#include <cinttypes> |
3 |
|
|
#include <vector> |
4 |
|
|
#include "base_object-inl.h" |
5 |
|
|
#include "util.h" |
6 |
|
|
|
7 |
|
|
namespace node { |
8 |
|
|
|
9 |
|
4941 |
const std::vector<intptr_t>& ExternalReferenceRegistry::external_references() { |
10 |
✗✓ |
4941 |
CHECK(!is_finalized_); |
11 |
|
4941 |
external_references_.push_back(reinterpret_cast<intptr_t>(nullptr)); |
12 |
|
4941 |
is_finalized_ = true; |
13 |
|
4941 |
return external_references_; |
14 |
|
|
} |
15 |
|
|
|
16 |
|
4941 |
ExternalReferenceRegistry::ExternalReferenceRegistry() { |
17 |
|
4941 |
this->Register(BaseObject::LazilyInitializedJSTemplateConstructor); |
18 |
|
|
|
19 |
|
|
#define V(modname) _register_external_reference_##modname(this); |
20 |
|
4941 |
EXTERNAL_REFERENCE_BINDING_LIST(V) |
21 |
|
|
#undef V |
22 |
|
|
// TODO(joyeecheung): collect more external references here. |
23 |
|
4941 |
} |
24 |
|
|
|
25 |
|
|
} // namespace node |