本文整理汇总了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()) {