GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: use ToLocal in DeserializeProperties · nodejs/node@685ed2c

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • env.cc
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/env.cc‎

Copy file name to clipboardExpand all lines: src/env.cc
+8-6Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,13 @@ void IsolateData::DeserializeProperties(const std::vector<size_t>* indexes) {
9292
#define VS(PropertyName, StringValue) V(String, PropertyName)
9393
#define V(TypeName, PropertyName) \
9494
do { \
95-
MaybeLocal<TypeName> field = \
95+
MaybeLocal<TypeName> maybe_field = \
9696
isolate_->GetDataFromSnapshotOnce<TypeName>((*indexes)[i++]); \
97-
if (field.IsEmpty()) { \
97+
Local<TypeName> field; \
98+
if (!maybe_field.ToLocal(&field)) { \
9899
fprintf(stderr, "Failed to deserialize " #PropertyName "\n"); \
99100
} \
100-
PropertyName##_.Set(isolate_, field.ToLocalChecked()); \
101+
PropertyName##_.Set(isolate_, field); \
101102
} while (0);
102103
PER_ISOLATE_PRIVATE_SYMBOL_PROPERTIES(VP)
103104
PER_ISOLATE_SYMBOL_PROPERTIES(VY)
@@ -108,12 +109,13 @@ void IsolateData::DeserializeProperties(const std::vector<size_t>* indexes) {
108109
#undef VP
109110

110111
for (size_t j = 0; j < AsyncWrap::PROVIDERS_LENGTH; j++) {
111-
MaybeLocal<String> field =
112+
MaybeLocal<String> maybe_field =
112113
isolate_->GetDataFromSnapshotOnce<String>((*indexes)[i++]);
113-
if (field.IsEmpty()) {
114+
Local<String> field;
115+
if (!maybe_field.ToLocal(&field)) {
114116
fprintf(stderr, "Failed to deserialize AsyncWrap provider %zu\n", j);
115117
}
116-
async_wrap_providers_[j].Set(isolate_, field.ToLocalChecked());
118+
async_wrap_providers_[j].Set(isolate_, field);
117119
}
118120
}
119121

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.