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: cast v8::Object::GetInternalField() return value to v8::Value · nodejs/node@ff334cb

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • base_object-inl.h
    • module_wrap.cc
    • node_file.cc
    • node_task_queue.cc
    • node_zlib.cc
    • stream_base.cc
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/base_object-inl.h‎

Copy file name to clipboardExpand all lines: src/base_object-inl.h
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ template <int Field>
127127
void BaseObject::InternalFieldGet(
128128
v8::Local<v8::String> property,
129129
const v8::PropertyCallbackInfo<v8::Value>& info) {
130-
info.GetReturnValue().Set(info.This()->GetInternalField(Field));
130+
info.GetReturnValue().Set(
131+
info.This()->GetInternalField(Field).As<v8::Value>());
131132
}
132133

133134
template <int Field, bool (v8::Value::* typecheck)() const>
Collapse file

‎src/module_wrap.cc‎

Copy file name to clipboardExpand all lines: src/module_wrap.cc
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ ModuleWrap::~ModuleWrap() {
7878
}
7979

8080
Local<Context> ModuleWrap::context() const {
81-
Local<Value> obj = object()->GetInternalField(kContextObjectSlot);
81+
Local<Value> obj = object()->GetInternalField(kContextObjectSlot).As<Value>();
8282
if (obj.IsEmpty()) return {};
8383
return obj.As<Object>()->GetCreationContext().ToLocalChecked();
8484
}
@@ -684,7 +684,9 @@ MaybeLocal<Value> ModuleWrap::SyntheticModuleEvaluationStepsCallback(
684684

685685
TryCatchScope try_catch(env);
686686
Local<Function> synthetic_evaluation_steps =
687-
obj->object()->GetInternalField(kSyntheticEvaluationStepsSlot)
687+
obj->object()
688+
->GetInternalField(kSyntheticEvaluationStepsSlot)
689+
.As<Value>()
688690
.As<Function>();
689691
obj->object()->SetInternalField(
690692
kSyntheticEvaluationStepsSlot, Undefined(isolate));
Collapse file

‎src/node_file.cc‎

Copy file name to clipboardExpand all lines: src/node_file.cc
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ MaybeLocal<Promise> FileHandle::ClosePromise() {
438438
Local<Context> context = env()->context();
439439

440440
Local<Value> close_resolver =
441-
object()->GetInternalField(FileHandle::kClosingPromiseSlot);
441+
object()->GetInternalField(FileHandle::kClosingPromiseSlot).As<Value>();
442442
if (!close_resolver.IsEmpty() && !close_resolver->IsUndefined()) {
443443
CHECK(close_resolver->IsPromise());
444444
return close_resolver.As<Promise>();
Collapse file

‎src/node_task_queue.cc‎

Copy file name to clipboardExpand all lines: src/node_task_queue.cc
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static Maybe<double> GetAssignedPromiseWrapAsyncId(Environment* env,
5050
// be an object. If it's not, we just ignore it. Ideally v8 would
5151
// have had GetInternalField returning a MaybeLocal but this works
5252
// for now.
53-
Local<Value> promiseWrap = promise->GetInternalField(0);
53+
Local<Value> promiseWrap = promise->GetInternalField(0).As<Value>();
5454
if (promiseWrap->IsObject()) {
5555
Local<Value> maybe_async_id;
5656
if (!promiseWrap.As<Object>()->Get(env->context(), id_symbol)
Collapse file

‎src/node_zlib.cc‎

Copy file name to clipboardExpand all lines: src/node_zlib.cc
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,8 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork {
423423
UpdateWriteResult();
424424

425425
// call the write() cb
426-
Local<Value> cb = object()->GetInternalField(kWriteJSCallback);
426+
Local<Value> cb =
427+
object()->GetInternalField(kWriteJSCallback).template As<Value>();
427428
MakeCallback(cb.As<Function>(), 0, nullptr);
428429

429430
if (pending_close_)
Collapse file

‎src/stream_base.cc‎

Copy file name to clipboardExpand all lines: src/stream_base.cc
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,9 @@ MaybeLocal<Value> StreamBase::CallJSOnreadMethod(ssize_t nread,
470470

471471
AsyncWrap* wrap = GetAsyncWrap();
472472
CHECK_NOT_NULL(wrap);
473-
Local<Value> onread = wrap->object()->GetInternalField(
474-
StreamBase::kOnReadFunctionField);
473+
Local<Value> onread = wrap->object()
474+
->GetInternalField(StreamBase::kOnReadFunctionField)
475+
.As<Value>();
475476
CHECK(onread->IsFunction());
476477
return wrap->MakeCallback(onread.As<Function>(), arraysize(argv), argv);
477478
}

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.