forked from ClearFoundry/ClearScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModuleCategory.cs
More file actions
89 lines (67 loc) · 2.18 KB
/
ModuleCategory.cs
File metadata and controls
89 lines (67 loc) · 2.18 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
82
83
84
85
86
87
88
89
// 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
{
get { return StandardModule.Instance; }
}
/// <summary>
/// Gets the document category for <see href="http://wiki.commonjs.org/wiki/Modules">CommonJS</see> modules.
/// </summary>
public static DocumentCategory CommonJS
{
get { return CommonJSModule.Instance; }
}
#region Nested type: StandardModule
private sealed class StandardModule : DocumentCategory
{
public static readonly StandardModule Instance = new StandardModule();
private StandardModule()
{
}
#region DocumentCategory overrides
internal override string DefaultName
{
get { return "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 CommonJSModule();
private CommonJSModule()
{
}
#region DocumentCategory overrides
internal override string DefaultName
{
get { return "Module"; }
}
#endregion
#region Object overrides
public override string ToString()
{
return "CommonJS Module";
}
#endregion
}
#endregion
}
}