Upload Kmake

This commit is contained in:
Gorochu
2026-05-26 23:36:42 -07:00
parent ba051b2f74
commit 555ec72358
41615 changed files with 13344630 additions and 1 deletions

View File

@ -0,0 +1,24 @@
#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

View File

@ -0,0 +1,9 @@
{
'targets': [
{
'target_name': 'binding',
'sources': [ 'binding.cc' ],
'includes': ['../common.gypi'],
}
]
}

View File

@ -0,0 +1,18 @@
'use strict';
const common = require('../../common');
const assert = require('assert');
const binding = require(`./build/${common.buildType}/binding`);
class Class extends binding.Class {
constructor() {
super();
this.method();
}
method() {
this.ok = true;
}
}
assert.ok(new Class() instanceof binding.Class);
assert.ok(new Class().ok);