Skip to content

Commit ba89298

Browse files
committed
Merge branch 'hotfix/fix-components-19' of https://github.com/EvilBeaver/OneScript into hotfix/fix-components-19
2 parents 3d810d0 + 7d0d9f6 commit ba89298

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

src/NUnitTests/TestContextClass.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ namespace NUnitTests
1414
public class TestContextClass : AutoContext<TestContextClass>
1515
{
1616

17-
[ContextMethod("УстаревшийМетод", "ObsoleteMethod", isDeprecated: true, throwOnUse: false)]
17+
[ContextMethod("УстаревшийМетод", "ObsoleteMethod", IsDeprecated = true, ThrowOnUse = false)]
1818
public void ObsoleteMethod()
1919
{
2020
// Do nothing
2121
}
2222

2323
[ContextMethod("ХорошийМетод", "GoodMethod")]
24-
[ContextMethod("ObsoleteAlias", null, isDeprecated: true, throwOnUse: false)]
25-
[ContextMethod("VeryObsoleteAlias", null, isDeprecated: true, throwOnUse: true)]
24+
[ContextMethod("ObsoleteAlias", IsDeprecated = true, ThrowOnUse = false)]
25+
[ContextMethod("VeryObsoleteAlias", IsDeprecated = true, ThrowOnUse = true)]
2626
public void GoodMethod()
2727
{
2828
// Do nothing

src/ScriptEngine.HostedScript/Library/SystemGlobalContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ public bool ValueIsFilled(IValue inValue)
482482

483483
}
484484

485-
[ContextMethod("IsValueFilled", null, isDeprecated: true, throwOnUse: false)]
485+
[ContextMethod("IsValueFilled", IsDeprecated = true, ThrowOnUse = false)]
486486
[Obsolete]
487487
public bool IsValueFilled(IValue value)
488488
{

src/ScriptEngine/Machine/Contexts/ContextMethodMapper.cs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class ContextMethodAttribute : Attribute
1616
private readonly string _name;
1717
private readonly string _alias;
1818

19-
public ContextMethodAttribute(string name, string alias, bool isDeprecated, bool throwOnUse)
19+
public ContextMethodAttribute(string name, string alias = null)
2020
{
2121
if(!Utils.IsValidIdentifier(name))
2222
throw new ArgumentException("Name must be a valid identifier");
@@ -26,13 +26,6 @@ public ContextMethodAttribute(string name, string alias, bool isDeprecated, bool
2626

2727
_name = name;
2828
_alias = alias;
29-
IsDeprecated = isDeprecated;
30-
ThrowOnUse = throwOnUse;
31-
}
32-
33-
public ContextMethodAttribute(string name, string alias = null)
34-
: this(name, alias, isDeprecated: false, throwOnUse: false)
35-
{
3629
}
3730

3831
public string GetName()
@@ -58,9 +51,9 @@ public string GetAlias(string nativeMethodName)
5851
return null;
5952
}
6053

61-
public bool IsDeprecated { get; }
54+
public bool IsDeprecated { get; set; }
6255

63-
public bool ThrowOnUse { get; }
56+
public bool ThrowOnUse { get; set; }
6457

6558
public bool IsFunction { get; set; }
6659
}

0 commit comments

Comments
 (0)