-
-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix doc #23
base: master
Are you sure you want to change the base?
fix doc #23
Changes from 2 commits
184832d
b78e7ac
18a3c67
36add47
8e5bc72
b2e5773
a93e2c5
2974549
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -392,7 +392,7 @@ is of a certain type, like `IsUndefined()`, `IsNull`, `IsNumber` etc. | |
It also has useful methods to convert to a Local<T>, for example: | ||
```c++ | ||
V8_WARN_UNUSED_RESULT MaybeLocal<Number> ToNumber(Local<Context> context) const; | ||
V8_WARN_UNUSED_RESULT MaybeLocal<String> ToNumber(Local<String> context) const; | ||
V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(Local<Context> context) const; | ||
... | ||
``` | ||
|
||
|
@@ -452,9 +452,9 @@ $19 = 0x5 | |
See [handle_test.cc](./test/handle_test.cc) for an example. | ||
|
||
### HandleScope | ||
Contains a number of Local/Handle's (think pointers to objects but is managed | ||
by V8) and will take care of deleting the Local/Handles for us. HandleScopes | ||
are stack allocated | ||
Contains a number of local handles (like pointers to objects but are managed | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In v8's source code, they use local handles rather than Local/Handles. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think So we can simplify the doc by omitting the |
||
by V8) and will take care of deleting the local handles for us. HandleScopes | ||
are stack allocated. | ||
|
||
When ~HandleScope is called all handles created within that scope are removed | ||
from the stack maintained by the HandleScope which makes objects to which the | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example code is from https://github.com/v8/v8/blob/ee74e718339223345b42935e9f4cbc7be208e557/include/v8-value.h#L355-L361