@@ -41,6 +41,7 @@ using v8::ArrayBuffer;
41
41
using v8::CFunction;
42
42
using v8::Context;
43
43
using v8::Float64Array;
44
+ using v8::Function;
44
45
using v8::FunctionCallbackInfo;
45
46
using v8::HeapStatistics;
46
47
using v8::Integer;
@@ -622,6 +623,12 @@ void BindingData::Deserialize(Local<Context> context,
622
623
CHECK_NOT_NULL (binding);
623
624
}
624
625
626
+ static void SetEmitWarningSync (const FunctionCallbackInfo<Value>& args) {
627
+ CHECK (args[0 ]->IsFunction ());
628
+ Environment* env = Environment::GetCurrent (args);
629
+ env->set_process_emit_warning_sync (args[0 ].As <Function>());
630
+ }
631
+
625
632
static void CreatePerIsolateProperties (IsolateData* isolate_data,
626
633
Local<ObjectTemplate> target) {
627
634
Isolate* isolate = isolate_data->isolate ();
@@ -655,6 +662,8 @@ static void CreatePerIsolateProperties(IsolateData* isolate_data,
655
662
SetMethod (isolate, target, " patchProcessObject" , PatchProcessObject);
656
663
657
664
SetMethod (isolate, target, " loadEnvFile" , LoadEnvFile);
665
+
666
+ SetMethod (isolate, target, " setEmitWarningSync" , SetEmitWarningSync);
658
667
}
659
668
660
669
static void CreatePerContextProperties (Local<Object> target,
@@ -695,6 +704,8 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
695
704
registry->Register (PatchProcessObject);
696
705
697
706
registry->Register (LoadEnvFile);
707
+
708
+ registry->Register (SetEmitWarningSync);
698
709
}
699
710
700
711
} // namespace process
0 commit comments