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,33 @@
'use strict';
// Test that the context parameter will be merged in multiple load hooks.
const common = require('../common');
const assert = require('assert');
const { registerHooks } = require('module');
const hook1 = registerHooks({
load: common.mustCall(function(url, context, nextLoad) {
assert.strictEqual(context.testProp, 'custom'); // It should be merged from hook 2 and 3.
return nextLoad(url, context);
}, 1),
});
const hook2 = registerHooks({
load: common.mustCall(function(url, context, nextLoad) {
assert.strictEqual(context.testProp, 'custom'); // It should be merged from hook 3.
return nextLoad(url); // Omit the context.
}, 1),
});
const hook3 = registerHooks({
load: common.mustCall(function(url, context, nextLoad) {
return nextLoad(url, { testProp: 'custom' }); // Add a custom property
}, 1),
});
require('../fixtures/empty.js');
hook3.deregister();
hook2.deregister();
hook1.deregister();