mirror of
https://github.com/nodejs/node.git
synced 2025-08-17 14:48:58 +02:00

`kNormal` has been the implicit default for a while now (since V8 7.6).
Refs: e0d7f81699
PR-URL: https://github.com/nodejs/node/pull/34248
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
24 lines
745 B
C++
24 lines
745 B
C++
#include <node.h>
|
|
#include <v8.h>
|
|
|
|
namespace {
|
|
|
|
inline void NewClass(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
|
// this != new.target since we are being invoked through super().
|
|
assert(args.IsConstructCall());
|
|
assert(!args.This()->StrictEquals(args.NewTarget()));
|
|
}
|
|
|
|
inline void Initialize(v8::Local<v8::Object> binding) {
|
|
auto isolate = binding->GetIsolate();
|
|
auto context = isolate->GetCurrentContext();
|
|
binding->Set(context, v8::String::NewFromUtf8(
|
|
isolate, "Class").ToLocalChecked(),
|
|
v8::FunctionTemplate::New(isolate, NewClass)
|
|
->GetFunction(context)
|
|
.ToLocalChecked()).FromJust();
|
|
}
|
|
|
|
NODE_MODULE(NODE_GYP_MODULE_NAME, Initialize)
|
|
|
|
} // anonymous namespace
|