File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -41,9 +41,9 @@ class ExampleAddon : public Napi::Addon<ExampleAddon> {
4141
4242 // We can also attach plain objects to `exports`, and instance methods as
4343 // properties of those sub-objects.
44- InstanceValue("subObject", DefineProperties(Napi::Object::New(), {
45- InstanceMethod("decrement", &ExampleAddon::Decrement
46- })) , napi_enumerable)
44+ InstanceValue("subObject", DefineProperties(Napi::Object::New(env ), {
45+ InstanceMethod("decrement", &ExampleAddon::Decrement)
46+ }), napi_enumerable)
4747 });
4848 }
4949 private:
@@ -80,7 +80,7 @@ The above code can be used from JavaScript as follows:
8080const exampleAddon = require('bindings')('example_addon');
8181console.log(exampleAddon.increment()); // prints 43
8282console.log(exampleAddon.increment()); // prints 44
83- consnole .log(exampleAddon.subObject.decrement()); // prints 43
83+ console .log(exampleAddon.subObject.decrement()); // prints 43
8484```
8585
8686When Node.js loads an instance of the add-on, a new instance of the class is
You can’t perform that action at this time.
0 commit comments