-
Notifications
You must be signed in to change notification settings - Fork 160
Expand file tree
/
Copy pathModuleCategory.cs
More file actions
81 lines (57 loc) · 2.11 KB
/
ModuleCategory.cs
File metadata and controls
81 lines (57 loc) · 2.11 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
namespace Microsoft.ClearScript.JavaScript
{
/// <summary>
/// Defines document categories for JavaScript modules.
/// </summary>
public static class ModuleCategory
{
/// <summary>
/// Gets the document category for standard <see href="https://www.ecma-international.org/ecma-262/6.0/#sec-modules">ECMAScript 6</see> modules.
/// </summary>
public static DocumentCategory Standard => StandardModule.Instance;
/// <summary>
/// Gets the document category for <see href="http://wiki.commonjs.org/wiki/Modules">CommonJS</see> modules.
/// </summary>
public static DocumentCategory CommonJS => CommonJSModule.Instance;
#region Nested type: StandardModule
private sealed class StandardModule : DocumentCategory
{
public static readonly StandardModule Instance = new();
private StandardModule()
{
}
#region DocumentCategory overrides
internal override DocumentKind Kind => DocumentKind.JavaScriptModule;
internal override string DefaultName => "Module";
#endregion
#region Object overrides
public override string ToString()
{
return "ECMAScript Module";
}
#endregion
}
#endregion
#region Nested type: CommonJSModule
private sealed class CommonJSModule : DocumentCategory
{
public static readonly CommonJSModule Instance = new();
private CommonJSModule()
{
}
#region DocumentCategory overrides
internal override DocumentKind Kind => DocumentKind.CommonJSModule;
internal override string DefaultName => "Module";
#endregion
#region Object overrides
public override string ToString()
{
return "CommonJS Module";
}
#endregion
}
#endregion
}
}