From ab1efabb7f13c28a7317fe0423e37bdac8df479f Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 24 Mar 2020 06:19:35 -0700 Subject: [PATCH 1/3] doc: trim wording in n-api.md text about exceptions --- doc/api/n-api.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/api/n-api.md b/doc/api/n-api.md index c6bdb172eb7181..6989bcdeab6c69 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -799,9 +799,8 @@ This API can be called even if there is a pending JavaScript exception. ### Exceptions Any N-API function call may result in a pending JavaScript exception. This is -obviously the case for any function that may cause the execution of -JavaScript, but N-API specifies that an exception may be pending -on return from any of the API functions. +the case for any of the API functions, even those that may not cause the +execution of JavaScript. If the `napi_status` returned by a function is `napi_ok` then no exception is pending and no additional action is required. If the From 5e350bcd8d48bf059fb0990d192250e1d56ea18a Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 24 Mar 2020 06:23:26 -0700 Subject: [PATCH 2/3] doc: remove unnecessary "obvious(ly)" modifiers in esm.md Remove "obvious" and "obviously" in two places in esm.md. It may be obvious to some, but likely not everyone or else it probably wouldn't be worth mentioning/documenting. --- doc/api/esm.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/esm.md b/doc/api/esm.md index fb1989b46eb0d0..99ba93e3bd10eb 100644 --- a/doc/api/esm.md +++ b/doc/api/esm.md @@ -518,7 +518,7 @@ would be usable by any version of Node.js, since `import` can refer to CommonJS files; but it would not provide any of the advantages of using ES module syntax. A package could also switch from CommonJS to ES module syntax in a breaking -change version bump. This has the obvious disadvantage that the newest version +change version bump. This has the disadvantage that the newest version of the package would only be usable in ES module-supporting versions of Node.js. Every pattern has tradeoffs, but there are two broad approaches that satisfy the @@ -1344,7 +1344,7 @@ JavaScript using the [`transformSource` hook][]. Before that hook gets called, however, other hooks need to tell Node.js not to throw an error on unknown file types; and to tell Node.js how to load this new file type. -This is obviously less performant than transpiling source files before running +This is less performant than transpiling source files before running Node.js; a transpiler loader should only be used for development and testing purposes. From 76f399e3a695b1458b4afb479ea89f90f0d4b4d4 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 24 Mar 2020 06:26:10 -0700 Subject: [PATCH 3/3] doc: remove extraneous sentence in events.md Since the previous sentence describes `10` as a default, and the following sentence explains how to modify that default, it is unnecessary to explain that "Obviously, not all events should be limited to just 10 listeners." --- doc/api/events.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/doc/api/events.md b/doc/api/events.md index 750473aa4c5114..b27c12cf557b30 100644 --- a/doc/api/events.md +++ b/doc/api/events.md @@ -740,10 +740,9 @@ added: v0.3.5 By default `EventEmitter`s will print a warning if more than `10` listeners are added for a particular event. This is a useful default that helps finding -memory leaks. Obviously, not all events should be limited to just 10 listeners. -The `emitter.setMaxListeners()` method allows the limit to be modified for this -specific `EventEmitter` instance. The value can be set to `Infinity` (or `0`) -to indicate an unlimited number of listeners. +memory leaks. The `emitter.setMaxListeners()` method allows the limit to be +modified for this specific `EventEmitter` instance. The value can be set to +`Infinity` (or `0`) to indicate an unlimited number of listeners. Returns a reference to the `EventEmitter`, so that calls can be chained.