diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2018-01-20 01:00:34 +0100 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2018-01-21 02:19:46 +0100 |
commit | d9b59def72c718aaad3eefb6bf43f409ccefe4d2 (patch) | |
tree | ec02442a3153500b91e368c873db4d1a3763e567 /test/addons/07_passing_wrapped_objects_around/myobject.h | |
parent | c6682636be4955e2181c00e7d4868fbf6682a5c5 (diff) | |
download | android-node-v8-d9b59def72c718aaad3eefb6bf43f409ccefe4d2.tar.gz android-node-v8-d9b59def72c718aaad3eefb6bf43f409ccefe4d2.tar.bz2 android-node-v8-d9b59def72c718aaad3eefb6bf43f409ccefe4d2.zip |
build,test: make building addon tests less fragile
* Get rid of recursive `make` when building the node binary. An earlier
commit makes GYP write out rules that we can use for proper dependency
tracking.
* Use module name 'binding' in addons.md and addons-napi/*/binding.gyp.
This massively simplifies the logic for generating the build rules.
* Check in auto-generated add-on tests from `doc/api/addons.md`. The
files change rarely and generating them dynamically causes no end of
race conditions and special-casing during the build.
PR-URL: https://github.com/nodejs/node/pull/17407
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Diffstat (limited to 'test/addons/07_passing_wrapped_objects_around/myobject.h')
-rw-r--r-- | test/addons/07_passing_wrapped_objects_around/myobject.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/addons/07_passing_wrapped_objects_around/myobject.h b/test/addons/07_passing_wrapped_objects_around/myobject.h new file mode 100644 index 0000000000..5d430a2081 --- /dev/null +++ b/test/addons/07_passing_wrapped_objects_around/myobject.h @@ -0,0 +1,28 @@ +// Auto-generated by `node tools/doc/addon-verify.js` +// myobject.h +#ifndef MYOBJECT_H // NOLINT(build/header_guard) +#define MYOBJECT_H // NOLINT(build/header_guard) + +#include <node.h> +#include <node_object_wrap.h> + +namespace demo { + +class MyObject : public node::ObjectWrap { + public: + static void Init(v8::Isolate* isolate); + static void NewInstance(const v8::FunctionCallbackInfo<v8::Value>& args); + inline double value() const { return value_; } + + private: + explicit MyObject(double value = 0); + ~MyObject(); + + static void New(const v8::FunctionCallbackInfo<v8::Value>& args); + static v8::Persistent<v8::Function> constructor; + double value_; +}; + +} // namespace demo + +#endif // NOLINT(build/header_guard) |