| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 166a9b8 commit 6076293
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -888,7 +888,10 @@ void TLSWrap::Initialize(Local<Object> target, | |||
| 888 | 888 | ||
| 889 | 889 | env->SetMethod(target, "wrap", TLSWrap::Wrap); | |
| 890 | 890 | ||
| 891 | - Local<FunctionTemplate> t = FunctionTemplate::New(env->isolate()); | ||
| 891 | + auto constructor = [](const FunctionCallbackInfo<Value>& args) { | ||
| 892 | + args.This()->SetAlignedPointerInInternalField(0, nullptr); | ||
| 893 | + }; | ||
| 894 | + auto t = env->NewFunctionTemplate(constructor); | ||
| 892 | 895 | t->InstanceTemplate()->SetInternalFieldCount(1); | |
| 893 | 896 | t->SetClassName(FIXED_ONE_BYTE_STRING(env->isolate(), "TLSWrap")); | |
| 894 | 897 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,8 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + | ||
| 3 | + require('../common'); | ||
| 4 | + const util = require('util'); | ||
| 5 | + const TLSWrap = process.binding('tls_wrap').TLSWrap; | ||
| 6 | + | ||
| 7 | + // This will abort if internal pointer is not set to nullptr. | ||
| 8 | + util.inspect(new TLSWrap()); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments