本文整理匯總了TypeScript中v8.setFlagsFromString函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript setFlagsFromString函數的具體用法?TypeScript setFlagsFromString怎麽用?TypeScript setFlagsFromString使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了setFlagsFromString函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: _runGarbageCollector
private _runGarbageCollector() {
const isGarbageCollectorHidden = !global.gc;
// GC is usually hidden, so we have to expose it before running.
v8.setFlagsFromString('--expose-gc');
vm.runInNewContext('gc')();
// The GC was not initially exposed, so let's hide it again.
if (isGarbageCollectorHidden) {
v8.setFlagsFromString('--no-expose-gc');
}
}
示例2: init
num = constants.POINT_CONVERSION_HYBRID;
str = constants.defaultCoreCipherList;
str = constants.defaultCipherList;
}
////////////////////////////////////////////////////
/// v8 tests : https://nodejs.org/api/v8.html
////////////////////////////////////////////////////
{
const heapStats = v8.getHeapStatistics();
const heapSpaceStats = v8.getHeapSpaceStatistics();
const zapsGarbage: number = heapStats.does_zap_garbage;
v8.setFlagsFromString('--collect_maps');
}
////////////////////////////////////////////////////
/// AsyncHooks tests : https://nodejs.org/api/async_hooks.html
////////////////////////////////////////////////////
{
const hooks: async_hooks.HookCallbacks = {
init() {},
before() {},
after() {},
destroy() {},
promiseResolve() {},
};
const asyncHook = async_hooks.createHook(hooks);
示例3: if
if (packageJson.productName != null) {
app.setName(`${packageJson.productName}`.trim())
} else if (packageJson.name != null) {
app.setName(`${packageJson.name}`.trim())
}
// Set application's desktop name.
if (packageJson.desktopName != null) {
app.setDesktopName(packageJson.desktopName)
} else {
app.setDesktopName((app.getName()) + '.desktop')
}
// Set v8 flags
if (packageJson.v8Flags != null) {
v8.setFlagsFromString(packageJson.v8Flags)
}
// Set the user path according to application's name.
app.setPath('userData', path.join(app.getPath('appData'), app.getName()))
app.setPath('userCache', path.join(app.getPath('cache'), app.getName()))
app.setAppPath(packagePath)
// Load the chrome devtools support.
require('@electron/internal/browser/chrome-devtools')
// Load the chrome extension support.
require('@electron/internal/browser/chrome-extension')
const features = process.atomBinding('features')
if (features.isDesktopCapturerEnabled()) {