Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichaƫl Zasso <targos@protonmail.com>2018-10-06 15:16:35 +0300
committerDaniel Bevenius <daniel.bevenius@gmail.com>2018-10-11 09:29:08 +0300
commit700fe5bbc489903578ff4d3d9da88651ae23213c (patch)
treee9dedc56184eec599d0b6f1cec4b359751becd42 /src/node.h
parentb409eaaf25dabe38f26e400ff01ffef598f0760d (diff)
src: fix usage of deprecated v8::Date::New
PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'src/node.h')
-rw-r--r--src/node.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/node.h b/src/node.h
index 8728745f431..f8b37c59c6e 100644
--- a/src/node.h
+++ b/src/node.h
@@ -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) {