Skip to content

Commit 8c6dc62

Browse files
vsemozhetbytMylesBorins
authored andcommitted
doc: dedupe links
Replace some repeated full links with concise ones and bottom references. PR-URL: #18213 Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 1fd1395 commit 8c6dc62

File tree

2 files changed

+34
-42
lines changed

2 files changed

+34
-42
lines changed

doc/api/errors.md

+9-8
Original file line numberDiff line numberDiff line change
@@ -1136,8 +1136,8 @@ is not supported.
11361136
### ERR_INVALID_SYNC_FORK_INPUT
11371137

11381138
A `Buffer`, `Uint8Array` or `string` was provided as stdio input to a
1139-
synchronous fork. See the documentation for the
1140-
[`child_process`](child_process.html) module for more information.
1139+
synchronous fork. See the documentation for the [`child_process`][] module
1140+
for more information.
11411141

11421142
<a id="ERR_INVALID_THIS"></a>
11431143
### ERR_INVALID_THIS
@@ -1193,22 +1193,22 @@ An attempt was made to use an IPC communication channel that was already closed.
11931193
### ERR_IPC_DISCONNECTED
11941194

11951195
An attempt was made to disconnect an IPC communication channel that was already
1196-
disconnected. See the documentation for the
1197-
[`child_process`](child_process.html) module for more information.
1196+
disconnected. See the documentation for the [`child_process`][] module
1197+
for more information.
11981198

11991199
<a id="ERR_IPC_ONE_PIPE"></a>
12001200
### ERR_IPC_ONE_PIPE
12011201

12021202
An attempt was made to create a child Node.js process using more than one IPC
1203-
communication channel. See the documentation for the
1204-
[`child_process`](child_process.html) module for more information.
1203+
communication channel. See the documentation for the [`child_process`][] module
1204+
for more information.
12051205

12061206
<a id="ERR_IPC_SYNC_FORK"></a>
12071207
### ERR_IPC_SYNC_FORK
12081208

12091209
An attempt was made to open an IPC communication channel with a synchronously
1210-
forked Node.js process. See the documentation for the
1211-
[`child_process`](child_process.html) module for more information.
1210+
forked Node.js process. See the documentation for the [`child_process`][] module
1211+
for more information.
12121212

12131213
<a id="ERR_METHOD_NOT_IMPLEMENTED"></a>
12141214
### ERR_METHOD_NOT_IMPLEMENTED
@@ -1563,6 +1563,7 @@ An attempt was made to use a `zlib` object after it has already been closed.
15631563
Creation of a [`zlib`][] object failed due to incorrect configuration.
15641564

15651565
[`--force-fips`]: cli.html#cli_force_fips
1566+
[`child_process`]: child_process.html
15661567
[`crypto.timingSafeEqual()`]: crypto.html#crypto_crypto_timingsafeequal_a_b
15671568
[`dgram.createSocket()`]: dgram.html#dgram_dgram_createsocket_options_callback
15681569
[`ERR_INVALID_ARG_TYPE`]: #ERR_INVALID_ARG_TYPE

doc/api/n-api.md

+25-34
Original file line numberDiff line numberDiff line change
@@ -1016,8 +1016,7 @@ typedef enum {
10161016

10171017
This represents the underlying binary scalar datatype of the TypedArray.
10181018
Elements of this enum correspond to
1019-
[Section 22.2](https://tc39.github.io/ecma262/#sec-typedarray-objects)
1020-
of the [ECMAScript Language Specification][].
1019+
[Section 22.2][] of the [ECMAScript Language Specification][].
10211020

10221021
### Object Creation Functions
10231022
#### napi_create_array
@@ -1035,8 +1034,7 @@ Returns `napi_ok` if the API succeeded.
10351034

10361035
This API returns an N-API value corresponding to a JavaScript Array type.
10371036
JavaScript arrays are described in
1038-
[Section 22.1](https://tc39.github.io/ecma262/#sec-array-objects) of the
1039-
ECMAScript Language Specification.
1037+
[Section 22.1][] of the ECMAScript Language Specification.
10401038

10411039
#### napi_create_array_with_length
10421040
<!-- YAML
@@ -1064,8 +1062,7 @@ directly read and/or written via C, consider using
10641062
[`napi_create_external_arraybuffer`][].
10651063

10661064
JavaScript arrays are described in
1067-
[Section 22.1](https://tc39.github.io/ecma262/#sec-array-objects) of the
1068-
ECMAScript Language Specification.
1065+
[Section 22.1][] of the ECMAScript Language Specification.
10691066

10701067
#### napi_create_arraybuffer
10711068
<!-- YAML
@@ -1096,8 +1093,7 @@ written to directly from native code. To write to this buffer from JavaScript,
10961093
a typed array or DataView object would need to be created.
10971094

10981095
JavaScript ArrayBuffer objects are described in
1099-
[Section 24.1](https://tc39.github.io/ecma262/#sec-arraybuffer-objects)
1100-
of the ECMAScript Language Specification.
1096+
[Section 24.1][] of the ECMAScript Language Specification.
11011097

11021098
#### napi_create_buffer
11031099
<!-- YAML
@@ -1209,8 +1205,7 @@ managed. The caller must ensure that the byte buffer remains valid until the
12091205
finalize callback is called.
12101206

12111207
JavaScript ArrayBuffers are described in
1212-
[Section 24.1](https://tc39.github.io/ecma262/#sec-arraybuffer-objects)
1213-
of the ECMAScript Language Specification.
1208+
[Section 24.1][] of the ECMAScript Language Specification.
12141209

12151210
#### napi_create_external_buffer
12161211
<!-- YAML
@@ -1351,8 +1346,7 @@ be <= the size in bytes of the array passed in. If not, a RangeError exception i
13511346
raised.
13521347

13531348
JavaScript TypedArray Objects are described in
1354-
[Section 22.2](https://tc39.github.io/ecma262/#sec-typedarray-objects)
1355-
of the ECMAScript Language Specification.
1349+
[Section 22.2][] of the ECMAScript Language Specification.
13561350

13571351

13581352
#### napi_create_dataview
@@ -1407,8 +1401,7 @@ This API is used to convert from the C `int32_t` type to the JavaScript
14071401
Number type.
14081402

14091403
The JavaScript Number type is described in
1410-
[Section 6.1.6](https://tc39.github.io/ecma262/#sec-ecmascript-language-types-number-type)
1411-
of the ECMAScript Language Specification.
1404+
[Section 6.1.6][] of the ECMAScript Language Specification.
14121405

14131406
#### napi_create_uint32
14141407
<!-- YAML
@@ -1428,8 +1421,7 @@ This API is used to convert from the C `uint32_t` type to the JavaScript
14281421
Number type.
14291422

14301423
The JavaScript Number type is described in
1431-
[Section 6.1.6](https://tc39.github.io/ecma262/#sec-ecmascript-language-types-number-type)
1432-
of the ECMAScript Language Specification.
1424+
[Section 6.1.6][] of the ECMAScript Language Specification.
14331425

14341426
#### napi_create_int64
14351427
<!-- YAML
@@ -1448,8 +1440,7 @@ Returns `napi_ok` if the API succeeded.
14481440
This API is used to convert from the C `int64_t` type to the JavaScript
14491441
Number type.
14501442

1451-
The JavaScript Number type is described in
1452-
[Section 6.1.6](https://tc39.github.io/ecma262/#sec-ecmascript-language-types-number-type)
1443+
The JavaScript Number type is described in [Section 6.1.6][]
14531444
of the ECMAScript Language Specification. Note the complete range of `int64_t`
14541445
cannot be represented with full precision in JavaScript. Integer values
14551446
outside the range of
@@ -1476,8 +1467,7 @@ This API is used to convert from the C `double` type to the JavaScript
14761467
Number type.
14771468

14781469
The JavaScript Number type is described in
1479-
[Section 6.1.6](https://tc39.github.io/ecma262/#sec-ecmascript-language-types-number-type)
1480-
of the ECMAScript Language Specification.
1470+
[Section 6.1.6][] of the ECMAScript Language Specification.
14811471

14821472
#### napi_create_string_latin1
14831473
<!-- YAML
@@ -1501,8 +1491,7 @@ Returns `napi_ok` if the API succeeded.
15011491
This API creates a JavaScript String object from a ISO-8859-1-encoded C string.
15021492

15031493
The JavaScript String type is described in
1504-
[Section 6.1.4](https://tc39.github.io/ecma262/#sec-ecmascript-language-types-string-type)
1505-
of the ECMAScript Language Specification.
1494+
[Section 6.1.4][] of the ECMAScript Language Specification.
15061495

15071496
#### napi_create_string_utf16
15081497
<!-- YAML
@@ -1526,8 +1515,7 @@ Returns `napi_ok` if the API succeeded.
15261515
This API creates a JavaScript String object from a UTF16-LE-encoded C string
15271516

15281517
The JavaScript String type is described in
1529-
[Section 6.1.4](https://tc39.github.io/ecma262/#sec-ecmascript-language-types-string-type)
1530-
of the ECMAScript Language Specification.
1518+
[Section 6.1.4][] of the ECMAScript Language Specification.
15311519

15321520
#### napi_create_string_utf8
15331521
<!-- YAML
@@ -1551,8 +1539,7 @@ Returns `napi_ok` if the API succeeded.
15511539
This API creates a JavaScript String object from a UTF8-encoded C string
15521540

15531541
The JavaScript String type is described in
1554-
[Section 6.1.4](https://tc39.github.io/ecma262/#sec-ecmascript-language-types-string-type)
1555-
of the ECMAScript Language Specification.
1542+
[Section 6.1.4][] of the ECMAScript Language Specification.
15561543

15571544
### Functions to convert from N-API to C types
15581545
#### napi_get_array_length
@@ -1981,7 +1968,7 @@ This API returns the Undefined object.
19811968
N-API exposes a set of APIs to perform some abstract operations on JavaScript
19821969
values. Some of these operations are documented under
19831970
[Section 7](https://tc39.github.io/ecma262/#sec-abstract-operations)
1984-
of the [ECMAScript Language Specification](https://tc39.github.io/ecma262/).
1971+
of the [ECMAScript Language Specification][].
19851972

19861973
These APIs support doing one of the following:
19871974
1. Coerce JavaScript values to specific JavaScript types (such as Number or
@@ -2249,7 +2236,7 @@ of the ECMAScript Language Specification.
22492236
N-API exposes a set of APIs to get and set properties on JavaScript
22502237
objects. Some of these types are documented under
22512238
[Section 7](https://tc39.github.io/ecma262/#sec-operations-on-objects) of the
2252-
[ECMAScript Language Specification](https://tc39.github.io/ecma262/).
2239+
[ECMAScript Language Specification][].
22532240

22542241
Properties in JavaScript are represented as a tuple of a key and a value.
22552242
Fundamentally, all property keys in N-API can be represented in one of the
@@ -2391,19 +2378,17 @@ typedef enum {
23912378

23922379
`napi_property_attributes` are flags used to control the behavior of properties
23932380
set on a JavaScript object. Other than `napi_static` they correspond to the
2394-
attributes listed in [Section 6.1.7.1](https://tc39.github.io/ecma262/#table-2)
2395-
of the [ECMAScript Language Specification](https://tc39.github.io/ecma262/).
2381+
attributes listed in [Section 6.1.7.1][]
2382+
of the [ECMAScript Language Specification][].
23962383
They can be one or more of the following bitflags:
23972384

23982385
- `napi_default` - Used to indicate that no explicit attributes are set on the
23992386
given property. By default, a property is read only, not enumerable and not
24002387
configurable.
24012388
- `napi_writable` - Used to indicate that a given property is writable.
24022389
- `napi_enumerable` - Used to indicate that a given property is enumerable.
2403-
- `napi_configurable` - Used to indicate that a given property is
2404-
configurable, as defined in
2405-
[Section 6.1.7.1](https://tc39.github.io/ecma262/#table-2) of the
2406-
[ECMAScript Language Specification](https://tc39.github.io/ecma262/).
2390+
- `napi_configurable` - Used to indicate that a given property is configurable,
2391+
as defined in [Section 6.1.7.1][] of the [ECMAScript Language Specification][].
24072392
- `napi_static` - Used to indicate that the property will be defined as
24082393
a static property on a class as opposed to an instance property, which is the
24092394
default. This is used only by [`napi_define_class`][]. It is ignored by
@@ -3716,8 +3701,14 @@ NAPI_EXTERN napi_status napi_get_uv_event_loop(napi_env env,
37163701
[Object Lifetime Management]: #n_api_object_lifetime_management
37173702
[Object Wrap]: #n_api_object_wrap
37183703
[Script Execution]: #n_api_script_execution
3704+
[Section 6.1.4]: https://tc39.github.io/ecma262/#sec-ecmascript-language-types-string-type
3705+
[Section 6.1.6]: https://tc39.github.io/ecma262/#sec-ecmascript-language-types-number-type
3706+
[Section 6.1.7.1]: https://tc39.github.io/ecma262/#table-2
37193707
[Section 9.1.6]: https://tc39.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-defineownproperty-p-desc
37203708
[Section 12.5.5]: https://tc39.github.io/ecma262/#sec-typeof-operator
3709+
[Section 22.1]: https://tc39.github.io/ecma262/#sec-array-objects
3710+
[Section 22.2]: https://tc39.github.io/ecma262/#sec-typedarray-objects
3711+
[Section 24.1]: https://tc39.github.io/ecma262/#sec-arraybuffer-objects
37213712
[Section 24.3]: https://tc39.github.io/ecma262/#sec-dataview-objects
37223713
[Section 25.4]: https://tc39.github.io/ecma262/#sec-promise-objects
37233714
[Working with JavaScript Functions]: #n_api_working_with_javascript_functions

0 commit comments

Comments
 (0)