-
Notifications
You must be signed in to change notification settings - Fork 30k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v8: fix ERR_NOT_BUILDING_SNAPSHOT is not a constructor
PR-URL: #47721 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
- Loading branch information
1 parent
e948bec
commit 606523d
Showing
3 changed files
with
35 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
'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', | ||
}); |