11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_ci 31cb0ef41Sopenharmony_ciconst common = require('../../common'); 41cb0ef41Sopenharmony_ciconst binding = require(`./build/${common.buildType}/test_buffer`); 51cb0ef41Sopenharmony_ciconst assert = require('assert'); 61cb0ef41Sopenharmony_ci 71cb0ef41Sopenharmony_ci// Regression test for https://github.com/nodejs/node/issues/31134 81cb0ef41Sopenharmony_ci// Buffers with finalizers are allowed to remain alive until 91cb0ef41Sopenharmony_ci// Environment cleanup without crashing the process. 101cb0ef41Sopenharmony_ci// The test stores the buffer on `process` to make sure it lives as long as 111cb0ef41Sopenharmony_ci// the Context does. 121cb0ef41Sopenharmony_ci 131cb0ef41Sopenharmony_ciprocess.externalBuffer = binding.newExternalBuffer(); 141cb0ef41Sopenharmony_ciassert.strictEqual(process.externalBuffer.toString(), binding.theText); 15