Skip to content

Commit cbbbd6c

Browse files
committed
fix: handle removed IdleNotificationDeadline
1 parent 5a9fcb8 commit cbbbd6c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

nan.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,14 @@ inline uv_loop_t* GetCurrentEventLoop() {
701701
NAN_DEPRECATED inline bool IdleNotification(int) {
702702
return true;
703703
}
704-
# elif defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \
704+
#elif defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 12 || \
705+
(V8_MAJOR_VERSION == 12 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 7))
706+
inline bool IdleNotification(int idle_time_in_ms) {
707+
v8::Isolate::GetCurrent()->MemoryPressureNotification(
708+
v8::MemoryPressureLevel::kModerate);
709+
return true;
710+
}
711+
#elif defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 ||
705712
(V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
706713
NAN_DEPRECATED inline bool IdleNotification(int idle_time_in_ms) {
707714
return v8::Isolate::GetCurrent()->IdleNotificationDeadline(

0 commit comments

Comments
 (0)