Skip to content

Commit

Permalink
doc: add leap second behavior notes for napi methods
Browse files Browse the repository at this point in the history
napi_create_date and napi_get_date_value ignore leap seconds as per
ECMAScript spec that follows POSIX spec for time, comments added to the
documentation where added fo clarify it.

PR-URL: #29569
Fixes: #29439
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • Loading branch information
levhita authored and BridgeAR committed Sep 25, 2019
1 parent 7fd3261 commit 55631f4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/api/n-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1774,6 +1774,9 @@ napi_status napi_create_date(napi_env env,

Returns `napi_ok` if the API succeeded.

This API does not observe leap seconds; they are ignored, as
ECMAScript aligns with POSIX time specification.

This API allocates a JavaScript `Date` object.

JavaScript `Date` objects are described in
Expand Down Expand Up @@ -2433,6 +2436,9 @@ napi_status napi_get_date_value(napi_env env,
* `[out] result`: Time value as a `double` represented as milliseconds
since midnight at the beginning of 01 January, 1970 UTC.

This API does not observe leap seconds; they are ignored, as
ECMAScript aligns with POSIX time specification.

Returns `napi_ok` if the API succeeded. If a non-date `napi_value` is passed
in it returns `napi_date_expected`.

Expand Down

0 comments on commit 55631f4

Please sign in to comment.