mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
bddf341774
PR-URL: https://github.com/nodejs/node/pull/47721 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
27 lines
653 B
JavaScript
27 lines
653 B
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
const assert = require('assert');
|
|
|
|
const {
|
|
isBuildingSnapshot,
|
|
addSerializeCallback,
|
|
addDeserializeCallback,
|
|
setDeserializeMainFunction
|
|
} = require('v8').startupSnapshot;
|
|
|
|
// This test verifies that the v8.startupSnapshot APIs are not available when
|
|
// it is not building snapshot.
|
|
|
|
assert(!isBuildingSnapshot());
|
|
|
|
assert.throws(() => addSerializeCallback(() => {}), {
|
|
code: 'ERR_NOT_BUILDING_SNAPSHOT',
|
|
});
|
|
assert.throws(() => addDeserializeCallback(() => {}), {
|
|
code: 'ERR_NOT_BUILDING_SNAPSHOT',
|
|
});
|
|
assert.throws(() => setDeserializeMainFunction(() => {}), {
|
|
code: 'ERR_NOT_BUILDING_SNAPSHOT',
|
|
});
|