summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorLevhita <levhita@gmail.com>2019-09-15 13:19:07 -0500
committerRich Trott <rtrott@gmail.com>2019-09-17 16:21:00 -0700
commit90b5cdb9e4462fe7d826cc4804cd91431db1682e (patch)
tree60b282ef015ae9027edf5d76221cd93989b26cfd /doc
parent80cc6f52f5a0618477117f87bff5e209711236de (diff)
downloadandroid-node-v8-90b5cdb9e4462fe7d826cc4804cd91431db1682e.tar.gz
android-node-v8-90b5cdb9e4462fe7d826cc4804cd91431db1682e.tar.bz2
android-node-v8-90b5cdb9e4462fe7d826cc4804cd91431db1682e.zip
doc: add leap second behavior notes for napi methods
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: https://github.com/nodejs/node/pull/29569 Fixes: https://github.com/nodejs/node/issues/29439 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/api/n-api.md6
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/api/n-api.md b/doc/api/n-api.md
index 241c50fc4d..f67825fe56 100644
--- a/doc/api/n-api.md
+++ b/doc/api/n-api.md
@@ -1775,6 +1775,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
@@ -2434,6 +2437,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`.