Skip to content

Commit b4e4827

Browse files
committed
Updated attributes.
1 parent f90293a commit b4e4827

2 files changed

Lines changed: 12 additions & 9 deletions

File tree

CSharpToJavaScript/APIs/JS/GlobalObject.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public static bool InequalsStrict(dynamic left, dynamic right)
4343
/// </remarks>
4444
/// <param name="arg">object.property</param>
4545
/// <returns>true for all cases except when the property is an own non-configurable property, in which case false is returned in non-strict mode.</returns>
46-
[Unary("delete ")]
46+
[Unary("delete")]
4747
public static bool Delete(dynamic arg)
4848
{
4949
return true;
@@ -57,7 +57,7 @@ public static bool Delete(dynamic arg)
5757
/// </remarks>
5858
/// <param name="arg">expression</param>
5959
/// <returns>Undefined</returns>
60-
[Unary("void ")]
60+
[Unary("void")]
6161
public static Undefined Void(dynamic arg)
6262
{
6363
return new Undefined();
@@ -71,7 +71,7 @@ public static Undefined Void(dynamic arg)
7171
/// </remarks>
7272
/// <param name="operand">An expression representing the object or primitive whose type is to be returned.</param>
7373
/// <returns>string</returns>
74-
[Unary("typeof ")]
74+
[Unary("typeof")]
7575
public static string TypeOf(object operand)
7676
{
7777
return string.Empty;
@@ -84,7 +84,7 @@ public static string TypeOf(object operand)
8484
/// </remarks>
8585
/// <param name="operand">An expression representing the object or primitive whose type is to be returned.</param>
8686
/// <returns>string</returns>
87-
[Unary("typeof ")]
87+
[Unary("typeof")]
8888
public static string TypeOf(Func<dynamic> operand)
8989
{
9090
return string.Empty;
@@ -97,7 +97,7 @@ public static string TypeOf(Func<dynamic> operand)
9797
/// </remarks>
9898
/// <typeparam name="O">An expression representing the object or primitive whose type is to be returned.</typeparam>
9999
/// <returns>string</returns>
100-
[GenericUnary("typeof ")]
100+
[GenericUnary("typeof")]
101101
public static string TypeOf<O>()
102102
{
103103
return string.Empty;
@@ -112,7 +112,7 @@ public static string TypeOf<O>()
112112
/// <typeparam name="C">Constructor to test against.</typeparam>
113113
/// <param name="obj">The object to test.</param>
114114
/// <returns>bool</returns>
115-
[GenericBinary(" instanceof ")]
115+
[GenericBinary("instanceof")]
116116
public static bool InstanceOf<C>(dynamic obj)
117117
{
118118
return true;

CSharpToJavaScript/Utils/Attributes.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System;
1+
using Microsoft.CodeAnalysis;
2+
using System;
23

34
namespace CSharpToJavaScript.Utils;
45

@@ -76,6 +77,7 @@ public string Convert(string str)
7677
[AttributeUsage(AttributeTargets.All)]
7778
public class BinaryAttribute : Attribute
7879
{
80+
public static SyntaxAnnotation Annotation { get; } = new(nameof(BinaryAttribute));
7981
public string Value { get; init; }
8082
public BinaryAttribute(string value)
8183
{
@@ -100,6 +102,7 @@ public GenericBinaryAttribute(string value)
100102
[AttributeUsage(AttributeTargets.All)]
101103
public class UnaryAttribute : Attribute
102104
{
105+
public static SyntaxAnnotation Annotation { get; } = new(nameof(UnaryAttribute));
103106
public string Value { get; init; }
104107
public UnaryAttribute(string value)
105108
{
@@ -125,8 +128,8 @@ public GenericUnaryAttribute(string value)
125128
[AttributeUsage(AttributeTargets.All)]
126129
public class ToObjectAttribute : Attribute
127130
{
128-
131+
public static SyntaxAnnotation Annotation { get; } = new(nameof(ToObjectAttribute));
129132
}
130133

131134
[AttributeUsage(AttributeTargets.Method)]
132-
public class GenericAsArgument : Attribute { }
135+
public class GenericAsArgumentAttribute : Attribute { }

0 commit comments

Comments
 (0)