// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System;
using System.Threading.Tasks;
namespace Microsoft.ClearScript.V8
{
///
/// Defines options for initializing a new V8 JavaScript engine instance.
///
[Flags]
public enum V8ScriptEngineFlags
{
// IMPORTANT: maintain bitwise equivalence with unmanaged enum V8Context::Flags
///
/// Specifies that no options are selected.
///
None = 0,
///
/// Specifies that script debugging features are to be enabled.
///
EnableDebugging = 0x00000001,
///
/// Specifies that support for behavior is to be
/// disabled. This option yields a significant performance benefit for global item access.
///
DisableGlobalMembers = 0x00000002,
///
/// Specifies that remote script debugging is to be enabled. This option is ignored if
/// is not specified.
///
EnableRemoteDebugging = 0x00000004,
///
/// Specifies that the script engine is to wait for a debugger connection and schedule a
/// pause before executing the first line of application script code. This option is
/// ignored if is not specified.
///
AwaitDebuggerAndPauseOnStart = 0x00000008,
///
/// Specifies that the script engine is to perform automatic conversion between
/// .NET objects and JavaScript
/// Date
/// objects. This conversion is bidirectional and lossy. A DateTime object
/// constructed from a JavaScript Date object always represents a Coordinated
/// Universal Time (UTC) and has its property set to
/// .
///
EnableDateTimeConversion = 0x00000010,
///
/// Specifies that
/// dynamic module imports
/// are to be enabled. This is an experimental feature and may be removed in a future release.
///
EnableDynamicModuleImports = 0x00000020,
///
/// Specifies that long integers with values greater than
/// Number.MAX_SAFE_INTEGER
/// or less than
/// Number.MIN_SAFE_INTEGER
/// are to be marshaled as
/// BigInt.
/// This option is ignored if is specified.
///
MarshalUnsafeLongAsBigInt = 0x00000040,
///
/// Specifies that all long integers are to be marshaled as
/// BigInt.
///
MarshalAllLongAsBigInt = 0x00000080,
///
/// Specifies that the script engine is to perform automatic conversion between
/// .NET objects and JavaScript
/// promises.
/// This conversion is bidirectional and lossy. A Task object constructed from a
/// JavaScript promise always has a result type of .
///
EnableTaskPromiseConversion = 0x00000100,
///
/// Specifies that the script engine is to perform automatic conversion from
/// .NET
/// ValueTask and
/// ValueTask<TResult>
/// structures to JavaScript
/// promises.
/// This conversion is unidirectional and lossy. This option is ignored if
/// is not specified.
///
EnableValueTaskPromiseConversion = 0x00000200,
///
/// Specifies that access to host object and class members is to be case-insensitive. This
/// option can introduce ambiguity if the host resource has distinct members whose names
/// differ only in case, so it should be used with caution.
///
UseCaseInsensitiveMemberBinding = 0x00000400,
///
/// Specifies that
/// JSON.stringify
/// enhancements are to be enabled. These enhancements add support for host objects via the
/// Json.NET library.
///
EnableStringifyEnhancements = 0x00000800,
///
/// Specifies that host exceptions are to be hidden from script code. If an exception
/// thrown by the host reaches the script engine, it is caught automatically, and an
/// Error
/// object is thrown in its place. By default, ClearScript makes the managed exception
/// accessible to script code via the Error object's hostException property.
/// This option suppresses that behavior.
///
HideHostExceptions = 0x00001000
}
}