We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d5fc875 commit 1331856Copy full SHA for 1331856
doc/handle_scope.md
@@ -61,3 +61,17 @@ Napi::Env Napi::HandleScope::Env() const;
61
```
62
63
Returns the `Napi::Env` associated with the `Napi::HandleScope`.
64
+
65
+## Example
66
67
+```cpp
68
+for (int i = 0; i < LOOP_MAX; i++) {
69
+ Napi::HandleScope scope(info.Env());
70
+ std::string name = std::string("inner-scope") + std::to_string(i);
71
+ Napi::Value newValue = Napi::String::New(info.Env(), name.c_str());
72
+ // do something with newValue
73
+};
74
+```
75
76
+For more details refer to the section titled [Object lifetime
77
+management](object_lifetime_management.md).
0 commit comments