Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 059db05

Browse filesBrowse files
goto-bus-stopaddaleax
authored andcommitted
doc: mention null special-case for napi_typeof
The documentation said `napi_typeof` is similar to the `typeof` operator, but the `typeof null` detects `'object'` while `napi_typeof(a_null_value)` detects `napi_null`. PR-URL: #34577 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>
1 parent 39f9034 commit 059db05
Copy full SHA for 059db05

File tree

Expand file treeCollapse file tree

1 file changed

+6
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-1
lines changed
Open diff view settings
Collapse file

‎doc/api/n-api.md‎

Copy file name to clipboardExpand all lines: doc/api/n-api.md
+6-1Lines changed: 6 additions & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -3125,7 +3125,12 @@ Returns `napi_ok` if the API succeeded.
31253125

31263126
This API represents behavior similar to invoking the `typeof` Operator on
31273127
the object as defined in [Section 12.5.5][] of the ECMAScript Language
3128-
Specification. However, it has support for detecting an External value.
3128+
Specification. However, there are some differences:
3129+
3130+
1. It has support for detecting an External value.
3131+
2. It detects `null` as a separate type, while ECMAScript `typeof` would detect
3132+
`object`.
3133+
31293134
If `value` has a type that is invalid, an error is returned.
31303135

31313136
### napi_instanceof

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.