From 0b39975cd40d58c0e251766dd515c8ce3f6f7573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Sat, 6 Oct 2018 14:16:35 +0200 Subject: [PATCH] src: fix usage of deprecated v8::Date::New PR-URL: https://github.com/nodejs/node/pull/23288 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Gus Caplan Reviewed-By: Sakthipriyan Vairamani Reviewed-By: Refael Ackermann Reviewed-By: James M Snell --- src/node.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/node.h b/src/node.h index bb2a9d2e0533ac..54136ec4987dc1 100644 --- a/src/node.h +++ b/src/node.h @@ -312,8 +312,11 @@ NODE_EXTERN struct uv_loop_s* GetCurrentEventLoop(v8::Isolate* isolate); /* Converts a unixtime to V8 Date */ NODE_DEPRECATED("Use v8::Date::New() directly", inline v8::Local NODE_UNIXTIME_V8(double time) { - return v8::Date::New(v8::Isolate::GetCurrent(), 1000 * time); -}) + return v8::Date::New( + v8::Isolate::GetCurrent()->GetCurrentContext(), + 1000 * time) + .ToLocalChecked(); + }) #define NODE_UNIXTIME_V8 node::NODE_UNIXTIME_V8 NODE_DEPRECATED("Use v8::Date::ValueOf() directly", inline double NODE_V8_UNIXTIME(v8::Local date) {