1'use strict'; 2 3const common = require('../../common'); 4const binding = require(`./build/${common.buildType}/test_buffer`); 5const assert = require('assert'); 6 7// Regression test for https://github.com/nodejs/node/issues/31134 8// Buffers with finalizers are allowed to remain alive until 9// Environment cleanup without crashing the process. 10// The test stores the buffer on `process` to make sure it lives as long as 11// the Context does. 12 13process.externalBuffer = binding.newExternalBuffer(); 14assert.strictEqual(process.externalBuffer.toString(), binding.theText); 15