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> {
41
41
42
42
// We can also attach plain objects to `exports`, and instance methods as
43
43
// 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)
47
47
});
48
48
}
49
49
private:
@@ -80,7 +80,7 @@ The above code can be used from JavaScript as follows:
80
80
const exampleAddon = require('bindings')('example_addon');
81
81
console.log(exampleAddon.increment()); // prints 43
82
82
console.log(exampleAddon.increment()); // prints 44
83
- consnole .log(exampleAddon.subObject.decrement()); // prints 43
83
+ console .log(exampleAddon.subObject.decrement()); // prints 43
84
84
```
85
85
86
86
When 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