mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
`kNormal` has been the implicit default for a while now (since V8 7.6). Refs: https://github.com/v8/v8/commit/e0d7f816990ada28ebe1281ca9431236ef8c6e4f 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>
25 lines
745 B
C++
25 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
|