GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: deprecate V8 date conversion helpers · nodejs/node@e9a0cff

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • node.h
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/node.h‎

Copy file name to clipboardExpand all lines: src/node.h
+10-3Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,16 @@ NODE_EXTERN void RunAtExit(Environment* env);
309309
NODE_EXTERN struct uv_loop_s* GetCurrentEventLoop(v8::Isolate* isolate);
310310

311311
/* Converts a unixtime to V8 Date */
312-
#define NODE_UNIXTIME_V8(t) v8::Date::New(v8::Isolate::GetCurrent(), \
313-
1000 * static_cast<double>(t))
314-
#define NODE_V8_UNIXTIME(v) (static_cast<double>((v)->NumberValue())/1000.0);
312+
NODE_DEPRECATED("Use v8::Date::New() directly",
313+
inline v8::Local<v8::Value> NODE_UNIXTIME_V8(double time) {
314+
return v8::Date::New(v8::Isolate::GetCurrent(), 1000 * time);
315+
})
316+
#define NODE_UNIXTIME_V8 node::NODE_UNIXTIME_V8
317+
NODE_DEPRECATED("Use v8::Date::ValueOf() directly",
318+
inline double NODE_V8_UNIXTIME(v8::Local<v8::Date> date) {
319+
return date->ValueOf() / 1000;
320+
})
321+
#define NODE_V8_UNIXTIME node::NODE_V8_UNIXTIME
315322

316323
#define NODE_DEFINE_CONSTANT(target, constant) \
317324
do { \

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.