mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
PR-URL: https://github.com/nodejs/node/pull/61191 Reviewed-By: Aviv Keller <me@aviv.sh> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
27 lines
524 B
JavaScript
27 lines
524 B
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const { GCProfiler } = require('v8');
|
|
|
|
{
|
|
const profiler = new GCProfiler();
|
|
profiler.start();
|
|
|
|
const result = profiler[Symbol.dispose]();
|
|
|
|
assert.strictEqual(result, undefined);
|
|
assert.strictEqual(profiler.stop(), undefined);
|
|
}
|
|
|
|
{
|
|
const profiler = new GCProfiler();
|
|
profiler.start();
|
|
|
|
profiler[Symbol.dispose]();
|
|
// Repeat invocations should not throw
|
|
profiler[Symbol.dispose]();
|
|
|
|
assert.strictEqual(profiler.stop(), undefined);
|
|
}
|