Skip to content

Commit acd291c

Browse files
committed
src: use ToV8Value in getConfigJsonSchema binding
1 parent 503ccb9 commit acd291c

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/node_options.cc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2311,11 +2311,9 @@ void GetOptionsAsFlags(const FunctionCallbackInfo<Value>& args) {
23112311
}
23122312

23132313
void GetConfigJsonSchema(const FunctionCallbackInfo<Value>& args) {
2314-
Isolate* isolate = args.GetIsolate();
2315-
std::string schema = options_parser::GenerateConfigJsonSchema(true);
2316-
Local<String> result;
2317-
if (!String::NewFromUtf8(
2318-
isolate, schema.data(), v8::NewStringType::kNormal, schema.size())
2314+
Local<Context> context = args.GetIsolate()->GetCurrentContext();
2315+
Local<Value> result;
2316+
if (!ToV8Value(context, options_parser::GenerateConfigJsonSchema(true))
23192317
.ToLocal(&result)) {
23202318
return;
23212319
}

0 commit comments

Comments
 (0)