@@ -41,6 +41,7 @@ using v8::ArrayBuffer;
4141using v8::CFunction;
4242using v8::Context;
4343using v8::Float64Array;
44+ using v8::Function;
4445using v8::FunctionCallbackInfo;
4546using v8::HeapStatistics;
4647using v8::Integer;
@@ -619,6 +620,12 @@ void BindingData::Deserialize(Local<Context> context,
619620 CHECK_NOT_NULL (binding);
620621}
621622
623+ static void SetEmitWarningSync (const FunctionCallbackInfo<Value>& args) {
624+ CHECK (args[0 ]->IsFunction ());
625+ Environment* env = Environment::GetCurrent (args);
626+ env->set_process_emit_warning_sync (args[0 ].As <Function>());
627+ }
628+
622629static void CreatePerIsolateProperties (IsolateData* isolate_data,
623630 Local<ObjectTemplate> target) {
624631 Isolate* isolate = isolate_data->isolate ();
@@ -651,6 +658,8 @@ static void CreatePerIsolateProperties(IsolateData* isolate_data,
651658 SetMethod (isolate, target, " patchProcessObject" , PatchProcessObject);
652659
653660 SetMethod (isolate, target, " loadEnvFile" , LoadEnvFile);
661+
662+ SetMethod (isolate, target, " setEmitWarningSync" , SetEmitWarningSync);
654663}
655664
656665static void CreatePerContextProperties (Local<Object> target,
@@ -690,6 +699,8 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
690699 registry->Register (PatchProcessObject);
691700
692701 registry->Register (LoadEnvFile);
702+
703+ registry->Register (SetEmitWarningSync);
693704}
694705
695706} // namespace process
0 commit comments