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 authored and danbev committed Oct 11, 2018
1 parent b409eaa commit 700fe5b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,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 700fe5b

Please sign in to comment.