���� JFIF �� � ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /home/real/node-v13.0.1/test/sequential/ |
'use strict'; const common = require('../common'); if (!common.isMainThread) common.skip('process.chdir is not available in Workers'); const { writeHeapSnapshot, getHeapSnapshot } = require('v8'); const assert = require('assert'); const fs = require('fs'); const tmpdir = require('../common/tmpdir'); tmpdir.refresh(); process.chdir(tmpdir.path); { writeHeapSnapshot('my.heapdump'); fs.accessSync('my.heapdump'); } { const heapdump = writeHeapSnapshot(); assert.strictEqual(typeof heapdump, 'string'); fs.accessSync(heapdump); } [1, true, {}, [], null, Infinity, NaN].forEach((i) => { common.expectsError(() => writeHeapSnapshot(i), { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "path" argument must be one of type string, Buffer, or URL.' + ` Received type ${typeof i}` }); }); { let data = ''; const snapshot = getHeapSnapshot(); snapshot.setEncoding('utf-8'); snapshot.on('data', common.mustCallAtLeast((chunk) => { data += chunk.toString(); })); snapshot.on('end', common.mustCall(() => { JSON.parse(data); })); }