Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix typos in documentation
  • Loading branch information
shivanth committed Jul 20, 2017
commit b56c76b11118d72add76fbc3ccba8448460617c3
9 changes: 3 additions & 6 deletions doc/api/n-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1332,7 +1332,7 @@ JavaScript TypedArray Objects are described in
of the ECMAScript Language Specification.


#### *napi_create_typedarray*
#### *napi_create_dataview*
<!-- YAML
added: v8.0.0
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added: REPLACEME

-->
Expand All @@ -1341,7 +1341,7 @@ napi_status napi_create_dataview(napi_env env,
size_t length,
napi_value arraybuffer,
size_t byte_offset,
napi_value* result) {
napi_value* result)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you align the arguments vertically (i.e. size_t length directly below napi_env env etc.?)


```

Expand All @@ -1358,12 +1358,9 @@ This API creates a JavaScript DataView object over an existing ArrayBuffer.
Dataview objects provide an array-like view over an underlying data buffer,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalization: Dataview

but one which allows items of different size and type in the ArrayBuffer.

It's required that (length * size_of_element) + byte_offset should
be <= the size in bytes of the array passed in. If not, a RangeError exception is
raised.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

napi_create_typedarray() has

It's required that (length * size_of_element) + byte_offset should be <= the size in bytes of the array passed in. If not, a RangeError exception is raised.

There should one here as well, with "(length * size_of_element)" replaced with byte_length.

JavaScript DataView Objects are described in
[Section 22.2](https://tc39.github.io/ecma262/#sec-dataview-objects)
[Section 24.3](https://tc39.github.io/ecma262/#sec-dataview-objects)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move the link to the bottom of the file.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that every napi_create_x function refers to the ECMA standards within it's section through out the document. Shouldn't we stick to this format ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should now just be [Section 24.3][]. Search the file for Section 12.5.5 for an example.

of the ECMAScript Language Specification.

### Functions to convert from C types to N-API
Expand Down