Skip to content

Commit

Permalink
src: fix usage of deprecated v8::Date::New
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
targos committed Oct 12, 2018
1 parent e34761f commit 8c04c37
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/node.h
Expand Up @@ -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<v8::Value> 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<v8::Date> date) {
Expand Down

0 comments on commit 8c04c37

Please sign in to comment.