@@ -40,9 +40,9 @@ This example code shows how to use the `FunctionReference` class.
40
40
41
41
### src/native-addon.h
42
42
43
- [ ** native-addon.h** ] ( https://github.com/nodejs/node-addon-examples/blob/main/src/4-references-and-handle-scope/function-reference-demo/src/native-addon.h )
43
+ [ ** native-addon.h** ] ( https://github.com/nodejs/node-addon-examples/blob/main/src/4-references-and-handle-scope/function-reference-demo/node-addon-api/ src/native-addon.h )
44
44
45
- ` embed:src/4-references-and-handle-scope/function-reference-demo/src/native-addon.h `
45
+ ` embed:src/4-references-and-handle-scope/function-reference-demo/node-addon-api/ src/native-addon.h `
46
46
47
47
The ` NativeAddon ` C++ class has two data members that are populated in the ` NativeAddon ` constructor:
48
48
@@ -51,9 +51,9 @@ The `NativeAddon` C++ class has two data members that are populated in the `Nati
51
51
52
52
### src/native-addon.cc
53
53
54
- [ ** native-addon.cc** ] ( https://github.com/nodejs/node-addon-examples/blob/main/src/4-references-and-handle-scope/function-reference-demo/src/native-addon.cc )
54
+ [ ** native-addon.cc** ] ( https://github.com/nodejs/node-addon-examples/blob/main/src/4-references-and-handle-scope/function-reference-demo/node-addon-api/ src/native-addon.cc )
55
55
56
- ` embed:src/4-references-and-handle-scope/function-reference-demo/src/native-addon.cc `
56
+ ` embed:src/4-references-and-handle-scope/function-reference-demo/node-addon-api/ src/native-addon.cc `
57
57
58
58
The ` NativeAddon ` constructor, which is called from JavaScript, takes two function arguments. The first argument is stored as a ` Napi::FunctionReference ` and the second is stored as a ` Napi::Function ` .
59
59
@@ -65,17 +65,17 @@ The `NativeAddon` class implements two methods which can be called from JavaScri
65
65
66
66
### src/binding.cc
67
67
68
- [ ** binding.cc** ] ( https://github.com/nodejs/node-addon-examples/blob/main/src/4-references-and-handle-scope/function-reference-demo/src/binding.cc )
68
+ [ ** binding.cc** ] ( https://github.com/nodejs/node-addon-examples/blob/main/src/4-references-and-handle-scope/function-reference-demo/node-addon-api/ src/binding.cc )
69
69
70
- ` embed:src/4-references-and-handle-scope/function-reference-demo/src/binding.cc `
70
+ ` embed:src/4-references-and-handle-scope/function-reference-demo/node-addon-api/ src/binding.cc `
71
71
72
72
This is a standard ` binding.cc ` file:
73
73
74
74
### index.js
75
75
76
- [ ** index.js** ] ( https://github.com/nodejs/node-addon-examples/blob/main/src/4-references-and-handle-scope/function-reference-demo/index.js )
76
+ [ ** index.js** ] ( https://github.com/nodejs/node-addon-examples/blob/main/src/4-references-and-handle-scope/function-reference-demo/node-addon-api/ index.js )
77
77
78
- ` embed:src/4-references-and-handle-scope/function-reference-demo/index.js `
78
+ ` embed:src/4-references-and-handle-scope/function-reference-demo/node-addon-api/ index.js `
79
79
80
80
This JavaScript code shows the use of the ` NativeAddon ` class. Note that the call to the native ` tryCallByStoredFunction ` method fails because the data member on which it relies is not valid.
81
81
0 commit comments