mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
13c4f44e97
Add a test that checks that new.target inheritance works when inheriting from a constructor defined in C++. PR-URL: https://github.com/nodejs/node/pull/9689 Refs: https://github.com/nodejs/node/issues/9288 Refs: https://github.com/nodejs/node/pull/9293 Reviewed-By: Anna Henningsen <anna@addaleax.net>
17 lines
411 B
C++
17 lines
411 B
C++
#include <node.h>
|
|
#include <v8.h>
|
|
|
|
namespace {
|
|
|
|
inline void NewClass(const v8::FunctionCallbackInfo<v8::Value>&) {}
|
|
|
|
inline void Initialize(v8::Local<v8::Object> binding) {
|
|
auto isolate = binding->GetIsolate();
|
|
binding->Set(v8::String::NewFromUtf8(isolate, "Class"),
|
|
v8::FunctionTemplate::New(isolate, NewClass)->GetFunction());
|
|
}
|
|
|
|
NODE_MODULE(binding, Initialize)
|
|
|
|
} // anonymous namespace
|