-
Notifications
You must be signed in to change notification settings - Fork 160
Expand file tree
/
Copy pathV8Settings.cs
More file actions
45 lines (42 loc) · 1.91 KB
/
V8Settings.cs
File metadata and controls
45 lines (42 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System;
namespace Microsoft.ClearScript.V8
{
/// <summary>
/// Defines properties that comprise ClearScript's V8 configuration.
/// </summary>
public static class V8Settings
{
/// <summary>
/// Enables or disables Top-Level Await.
/// </summary>
/// <remarks>
/// <para>
/// <see href="https://github.com/tc39/proposal-top-level-await">Top-Level Await</see>
/// enables code at the outermost scope of an
/// <see href="https://www.ecma-international.org/ecma-262/6.0/#sec-modules">ECMAScript 6</see>
/// module to be executed as an
/// <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function">async function</see>.
/// When this feature is enabled, modules can <c>await</c> resources, causing importers to
/// delay evaluation as necessary.
/// </para>
/// <para>
/// To enable Top-Level Await, set this property to <c>true</c> before instantiating
/// <c><see cref="V8ScriptEngine"/></c> or <c><see cref="V8Runtime"/></c> for the first time. Subsequent
/// reassignment will have no effect.
/// </para>
/// </remarks>
[Obsolete("V8 no longer supports Top-Level Await control. The feature is always enabled.")]
public static bool EnableTopLevelAwait { get; set; }
/// <summary>
/// Gets or sets global V8 options.
/// </summary>
/// <remarks>
/// To override the default global options, set this property before instantiating
/// <c><see cref="V8ScriptEngine"/></c> or <c><see cref="V8Runtime"/></c> for the first time. Subsequent
/// reassignment will have no effect.
/// </remarks>
public static V8GlobalFlags GlobalFlags { get; set; }
}
}