@@ -40,9 +40,9 @@ This example code shows how to use the `FunctionReference` class.
4040
4141### src/native-addon.h
4242
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 )
4444
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 `
4646
4747The ` NativeAddon ` C++ class has two data members that are populated in the ` NativeAddon ` constructor:
4848
@@ -51,9 +51,9 @@ The `NativeAddon` C++ class has two data members that are populated in the `Nati
5151
5252### src/native-addon.cc
5353
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 )
5555
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 `
5757
5858The ` 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 ` .
5959
@@ -65,17 +65,17 @@ The `NativeAddon` class implements two methods which can be called from JavaScri
6565
6666### src/binding.cc
6767
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 )
6969
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 `
7171
7272This is a standard ` binding.cc ` file:
7373
7474### index.js
7575
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 )
7777
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 `
7979
8080This 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.
8181
0 commit comments