From d742535184655a04aafbf266522231aa1b7430c2 Mon Sep 17 00:00:00 2001 From: legendecas Date: Tue, 1 Oct 2019 14:19:26 +0800 Subject: doc: reuse link indexes for n-api.md PR-URL: https://github.com/nodejs/node/pull/29787 Reviewed-By: Ruben Bridgewater Reviewed-By: James M Snell Reviewed-By: Gabriel Schulhof Reviewed-By: Michael Dawson --- doc/api/n-api.md | 98 ++++++++++++++++++++++++++------------------------------ 1 file changed, 45 insertions(+), 53 deletions(-) (limited to 'doc') diff --git a/doc/api/n-api.md b/doc/api/n-api.md index ff4f9da3e8..d0bd46e790 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -37,8 +37,7 @@ properties: The N-API is a C API that ensures ABI stability across Node.js versions and different compiler levels. A C++ API can be easier to use. To support using C++, the project maintains a -C++ wrapper module called -[node-addon-api](https://github.com/nodejs/node-addon-api). +C++ wrapper module called [node-addon-api][]. This wrapper provides an inlineable C++ API. Binaries built with `node-addon-api` will depend on the symbols for the N-API C-based functions exported by Node.js. `node-addon-api` is a more @@ -1557,8 +1556,7 @@ API. ## Working with JavaScript Values N-API exposes a set of APIs to create all types of JavaScript values. -Some of these types are documented under -[Section 6](https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values) +Some of these types are documented under [Section 6][] of the [ECMAScript Language Specification][]. Fundamentally, these APIs are used to do one of the following: @@ -1594,9 +1592,7 @@ typedef enum { ``` Describes the type of a `napi_value`. This generally corresponds to the types -described in -[Section 6.1](https://tc39.github.io/ecma262/#sec-ecmascript-language-types) of -the ECMAScript Language Specification. +described in [Section 6.1][] of the ECMAScript Language Specification. In addition to types in that section, `napi_valuetype` can also represent `Function`s and `Object`s with external data. @@ -1926,8 +1922,7 @@ Returns `napi_ok` if the API succeeded. This API allocates a default JavaScript `Object`. It is the equivalent of doing `new Object()` in JavaScript. -The JavaScript `Object` type is described in -[Section 6.1.7](https://tc39.github.io/ecma262/#sec-object-type) of the +The JavaScript `Object` type is described in [Section 6.1.7][] of the ECMAScript Language Specification. #### napi_create_symbol @@ -1951,8 +1946,7 @@ Returns `napi_ok` if the API succeeded. This API creates a JavaScript `Symbol` object from a UTF8-encoded C string. -The JavaScript `Symbol` type is described in -[Section 19.4](https://tc39.github.io/ecma262/#sec-symbol-objects) +The JavaScript `Symbol` type is described in [Section 19.4][] of the ECMAScript Language Specification. #### napi_create_typedarray @@ -2093,11 +2087,8 @@ This API is used to convert from the C `int64_t` type to the JavaScript The JavaScript `Number` type is described in [Section 6.1.6][] of the ECMAScript Language Specification. Note the complete range of `int64_t` cannot be represented with full precision in JavaScript. Integer values -outside the range of -[`Number.MIN_SAFE_INTEGER`](https://tc39.github.io/ecma262/#sec-number.min_safe_integer) --(2^53 - 1) - -[`Number.MAX_SAFE_INTEGER`](https://tc39.github.io/ecma262/#sec-number.max_safe_integer) -(2^53 - 1) will lose precision. +outside the range of [`Number.MIN_SAFE_INTEGER`][] `-(2^53 - 1)` - +[`Number.MAX_SAFE_INTEGER`][] `(2^53 - 1)` will lose precision. #### napi_create_double