Skip to content

Commit 4d21e34

Browse files
targosjasnell
authored andcommitted
src: fix usage of deprecated v8::Date::New
PR-URL: #23288 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 3c4d316 commit 4d21e34

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/node.h

+5-2
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,11 @@ NODE_EXTERN struct uv_loop_s* GetCurrentEventLoop(v8::Isolate* isolate);
287287
/* Converts a unixtime to V8 Date */
288288
NODE_DEPRECATED("Use v8::Date::New() directly",
289289
inline v8::Local<v8::Value> NODE_UNIXTIME_V8(double time) {
290-
return v8::Date::New(v8::Isolate::GetCurrent(), 1000 * time);
291-
})
290+
return v8::Date::New(
291+
v8::Isolate::GetCurrent()->GetCurrentContext(),
292+
1000 * time)
293+
.ToLocalChecked();
294+
})
292295
#define NODE_UNIXTIME_V8 node::NODE_UNIXTIME_V8
293296
NODE_DEPRECATED("Use v8::Date::ValueOf() directly",
294297
inline double NODE_V8_UNIXTIME(v8::Local<v8::Date> date) {

0 commit comments

Comments
 (0)