mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
This reverts commit d9b59def72.
Breaks downloadable source tarball builds as we remove some files prior
to creating a tarball but those files are included in the comprehensive
list of dependencies listed in .deps.
Ref: https://github.com/nodejs/node/pull/17407
PR-URL: https://github.com/nodejs/node/pull/18287
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
22 lines
738 B
JavaScript
22 lines
738 B
JavaScript
'use strict';
|
|
// Flags: --expose-gc
|
|
|
|
const common = require('../../common');
|
|
const binding = require(`./build/${common.buildType}/test_buffer`);
|
|
const assert = require('assert');
|
|
|
|
assert.strictEqual(binding.newBuffer().toString(), binding.theText);
|
|
assert.strictEqual(binding.newExternalBuffer().toString(), binding.theText);
|
|
console.log('gc1');
|
|
global.gc();
|
|
assert.strictEqual(binding.getDeleterCallCount(), 1);
|
|
assert.strictEqual(binding.copyBuffer().toString(), binding.theText);
|
|
|
|
let buffer = binding.staticBuffer();
|
|
assert.strictEqual(binding.bufferHasInstance(buffer), true);
|
|
assert.strictEqual(binding.bufferInfo(buffer), true);
|
|
buffer = null;
|
|
global.gc();
|
|
console.log('gc2');
|
|
assert.strictEqual(binding.getDeleterCallCount(), 2);
|