Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
runtime
提交
6d47f766
R
runtime
项目概览
dotNET Platform
/
runtime
12 个月 前同步成功
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
runtime
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
6d47f766
编写于
11月 02, 2022
作者:
A
Adeel Mujahid
提交者:
GitHub
11月 02, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use SR.Format in a few more places (#77615)
上级
fdaaa61d
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
34 addition
and
34 deletion
+34
-34
src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/CompositionExceptionTests.cs
...m/ComponentModel/Composition/CompositionExceptionTests.cs
+2
-2
src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/TypeCatalogTests.cs
...em/ComponentModel/Composition/Hosting/TypeCatalogTests.cs
+2
-2
src/libraries/System.Configuration.ConfigurationManager/tests/System/Configuration/ExceptionUtilTests.cs
...nManager/tests/System/Configuration/ExceptionUtilTests.cs
+5
-5
src/libraries/System.Configuration.ConfigurationManager/tests/System/Configuration/ValidatiorUtilsTests.cs
...anager/tests/System/Configuration/ValidatiorUtilsTests.cs
+2
-2
src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSGeneratorFactory.cs
...es.JavaScript/gen/JSImportGenerator/JSGeneratorFactory.cs
+15
-15
src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/Analyzers/ConvertToLibraryImportFixer.cs
...yImportGenerator/Analyzers/ConvertToLibraryImportFixer.cs
+2
-2
src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/AttributedMarshallingModelGeneratorFactory.cs
...Marshalling/AttributedMarshallingModelGeneratorFactory.cs
+4
-4
src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/CharMarshallingGeneratorFactory.cs
...Generation/Marshalling/CharMarshallingGeneratorFactory.cs
+1
-1
src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs
src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs
+1
-1
未找到文件。
src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/CompositionExceptionTests.cs
浏览文件 @
6d47f766
...
@@ -416,8 +416,8 @@ private void AssertMessage(CompositionException exception, int rootCauseCount, C
...
@@ -416,8 +416,8 @@ private void AssertMessage(CompositionException exception, int rootCauseCount, C
}
}
else
else
{
{
string
option1
=
string
.
Format
(
CultureInfo
.
CurrentCulture
,
SR
.
CompositionException_SingleErrorWithMultiplePaths
,
rootCauseCount
);
string
option1
=
SR
.
Format
(
SR
.
CompositionException_SingleErrorWithMultiplePaths
,
rootCauseCount
);
string
option2
=
string
.
Format
(
CultureInfo
.
CurrentCulture
,
SR
.
CompositionException_MultipleErrorsWithMultiplePaths
,
rootCauseCount
);
string
option2
=
SR
.
Format
(
SR
.
CompositionException_MultipleErrorsWithMultiplePaths
,
rootCauseCount
);
if
(!
line
.
Contains
(
option1
)
&&
!
line
.
Contains
(
option2
))
if
(!
line
.
Contains
(
option1
)
&&
!
line
.
Contains
(
option2
))
{
{
throw
new
XunitException
(
$"`
{
line
}
` contains neither `
{
option1
}
` nor `
{
option2
}
`"
);
throw
new
XunitException
(
$"`
{
line
}
` contains neither `
{
option1
}
` nor `
{
option2
}
`"
);
...
...
src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/TypeCatalogTests.cs
浏览文件 @
6d47f766
...
@@ -288,7 +288,7 @@ public void ICompositionElementDisplayName_SingleTypeAsTypesArgument_ShouldInclu
...
@@ -288,7 +288,7 @@ public void ICompositionElementDisplayName_SingleTypeAsTypesArgument_ShouldInclu
{
{
var
catalog
=
(
ICompositionElement
)
CreateTypeCatalog
(
e
);
var
catalog
=
(
ICompositionElement
)
CreateTypeCatalog
(
e
);
string
expected
=
string
.
Format
(
SR
.
TypeCatalog_DisplayNameFormat
,
typeof
(
TypeCatalog
).
Name
,
AttributedModelServices
.
GetTypeIdentity
(
e
));
string
expected
=
SR
.
Format
(
SR
.
TypeCatalog_DisplayNameFormat
,
typeof
(
TypeCatalog
).
Name
,
AttributedModelServices
.
GetTypeIdentity
(
e
));
Assert
.
Equal
(
expected
,
catalog
.
DisplayName
);
Assert
.
Equal
(
expected
,
catalog
.
DisplayName
);
}
}
...
@@ -334,7 +334,7 @@ public void ICompositionElementDisplayName_ShouldIncludeDerivedCatalogTypeNameAn
...
@@ -334,7 +334,7 @@ public void ICompositionElementDisplayName_ShouldIncludeDerivedCatalogTypeNameAn
{
{
var
catalog
=
(
ICompositionElement
)
new
DerivedTypeCatalog
(
e
);
var
catalog
=
(
ICompositionElement
)
new
DerivedTypeCatalog
(
e
);
string
expected
=
string
.
Format
(
SR
.
TypeCatalog_DisplayNameFormat
,
typeof
(
DerivedTypeCatalog
).
Name
,
AttributedModelServices
.
GetTypeIdentity
(
e
));
string
expected
=
SR
.
Format
(
SR
.
TypeCatalog_DisplayNameFormat
,
typeof
(
DerivedTypeCatalog
).
Name
,
AttributedModelServices
.
GetTypeIdentity
(
e
));
Assert
.
Equal
(
expected
,
catalog
.
DisplayName
);
Assert
.
Equal
(
expected
,
catalog
.
DisplayName
);
}
}
...
...
src/libraries/System.Configuration.ConfigurationManager/tests/System/Configuration/ExceptionUtilTests.cs
浏览文件 @
6d47f766
...
@@ -88,7 +88,7 @@ public void ParameterInvalid()
...
@@ -88,7 +88,7 @@ public void ParameterInvalid()
ArgumentException
e
=
ExceptionUtil
.
ParameterInvalid
(
"foo"
);
ArgumentException
e
=
ExceptionUtil
.
ParameterInvalid
(
"foo"
);
Assert
.
NotNull
(
e
);
Assert
.
NotNull
(
e
);
Assert
.
Equal
(
"foo"
,
e
.
ParamName
);
Assert
.
Equal
(
"foo"
,
e
.
ParamName
);
Assert
.
StartsWith
(
string
.
Format
(
SR
.
GetResourceString
(
"Parameter_Invalid"
,
null
),
"foo"
),
e
.
Message
);
Assert
.
StartsWith
(
SR
.
Format
(
SR
.
GetResourceString
(
"Parameter_Invalid"
,
null
),
"foo"
),
e
.
Message
);
}
}
[
Fact
]
[
Fact
]
...
@@ -97,7 +97,7 @@ public void ParameterNullOrEmpty()
...
@@ -97,7 +97,7 @@ public void ParameterNullOrEmpty()
ArgumentException
e
=
ExceptionUtil
.
ParameterNullOrEmpty
(
"foo"
);
ArgumentException
e
=
ExceptionUtil
.
ParameterNullOrEmpty
(
"foo"
);
Assert
.
NotNull
(
e
);
Assert
.
NotNull
(
e
);
Assert
.
Equal
(
"foo"
,
e
.
ParamName
);
Assert
.
Equal
(
"foo"
,
e
.
ParamName
);
Assert
.
StartsWith
(
string
.
Format
(
SR
.
GetResourceString
(
"Parameter_NullOrEmpty"
,
null
),
"foo"
),
e
.
Message
);
Assert
.
StartsWith
(
SR
.
Format
(
SR
.
GetResourceString
(
"Parameter_NullOrEmpty"
,
null
),
"foo"
),
e
.
Message
);
}
}
[
Fact
]
[
Fact
]
...
@@ -106,7 +106,7 @@ public void PropertyInvalid()
...
@@ -106,7 +106,7 @@ public void PropertyInvalid()
ArgumentException
e
=
ExceptionUtil
.
PropertyInvalid
(
"foo"
);
ArgumentException
e
=
ExceptionUtil
.
PropertyInvalid
(
"foo"
);
Assert
.
NotNull
(
e
);
Assert
.
NotNull
(
e
);
Assert
.
Equal
(
"foo"
,
e
.
ParamName
);
Assert
.
Equal
(
"foo"
,
e
.
ParamName
);
Assert
.
StartsWith
(
string
.
Format
(
SR
.
GetResourceString
(
"Property_Invalid"
,
null
),
"foo"
),
e
.
Message
);
Assert
.
StartsWith
(
SR
.
Format
(
SR
.
GetResourceString
(
"Property_Invalid"
,
null
),
"foo"
),
e
.
Message
);
}
}
[
Fact
]
[
Fact
]
...
@@ -115,7 +115,7 @@ public void PropertyNullOrEmpty()
...
@@ -115,7 +115,7 @@ public void PropertyNullOrEmpty()
ArgumentException
e
=
ExceptionUtil
.
PropertyNullOrEmpty
(
"foo"
);
ArgumentException
e
=
ExceptionUtil
.
PropertyNullOrEmpty
(
"foo"
);
Assert
.
NotNull
(
e
);
Assert
.
NotNull
(
e
);
Assert
.
Equal
(
"foo"
,
e
.
ParamName
);
Assert
.
Equal
(
"foo"
,
e
.
ParamName
);
Assert
.
StartsWith
(
string
.
Format
(
SR
.
GetResourceString
(
"Property_NullOrEmpty"
,
null
),
"foo"
),
e
.
Message
);
Assert
.
StartsWith
(
SR
.
Format
(
SR
.
GetResourceString
(
"Property_NullOrEmpty"
,
null
),
"foo"
),
e
.
Message
);
}
}
[
Fact
]
[
Fact
]
...
@@ -123,7 +123,7 @@ public void UnexpectedError()
...
@@ -123,7 +123,7 @@ public void UnexpectedError()
{
{
InvalidOperationException
e
=
ExceptionUtil
.
UnexpectedError
(
"foo"
);
InvalidOperationException
e
=
ExceptionUtil
.
UnexpectedError
(
"foo"
);
Assert
.
NotNull
(
e
);
Assert
.
NotNull
(
e
);
Assert
.
StartsWith
(
string
.
Format
(
SR
.
GetResourceString
(
"Unexpected_Error"
,
null
),
"foo"
),
e
.
Message
);
Assert
.
StartsWith
(
SR
.
Format
(
SR
.
GetResourceString
(
"Unexpected_Error"
,
null
),
"foo"
),
e
.
Message
);
}
}
}
}
}
}
src/libraries/System.Configuration.ConfigurationManager/tests/System/Configuration/ValidatiorUtilsTests.cs
浏览文件 @
6d47f766
...
@@ -53,7 +53,7 @@ public void ValidateIntScalar(int value, int min, int max, int resolution, bool
...
@@ -53,7 +53,7 @@ public void ValidateIntScalar(int value, int min, int max, int resolution, bool
else
else
{
{
Assert
.
Equal
(
Assert
.
Equal
(
string
.
Format
(
SR
.
GetResourceString
(
message
,
null
),
min
,
max
),
SR
.
Format
(
SR
.
GetResourceString
(
message
,
null
),
min
,
max
),
AssertExtensions
.
Throws
<
ArgumentException
>(
null
,
action
).
Message
);
AssertExtensions
.
Throws
<
ArgumentException
>(
null
,
action
).
Message
);
}
}
}
}
...
@@ -72,7 +72,7 @@ public void ValidateIntBadResolution(int value, int min, int max, int resolution
...
@@ -72,7 +72,7 @@ public void ValidateIntBadResolution(int value, int min, int max, int resolution
else
else
{
{
Assert
.
Equal
(
Assert
.
Equal
(
string
.
Format
(
SR
.
GetResourceString
(
message
,
null
),
resolution
),
SR
.
Format
(
SR
.
GetResourceString
(
message
,
null
),
resolution
),
AssertExtensions
.
Throws
<
ArgumentException
>(
null
,
action
).
Message
);
AssertExtensions
.
Throws
<
ArgumentException
>(
null
,
action
).
Message
);
}
}
}
}
...
...
src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSGeneratorFactory.cs
浏览文件 @
6d47f766
...
@@ -127,7 +127,7 @@ internal static BaseJSGenerator Create(TypePositionInfo info, bool isToJs, Known
...
@@ -127,7 +127,7 @@ internal static BaseJSGenerator Create(TypePositionInfo info, bool isToJs, Known
case
KnownManagedType
.
DateTime
when
jsType
==
JSTypeFlags
.
Missing
:
case
KnownManagedType
.
DateTime
when
jsType
==
JSTypeFlags
.
Missing
:
case
KnownManagedType
.
DateTimeOffset
when
jsType
==
JSTypeFlags
.
Missing
:
case
KnownManagedType
.
DateTimeOffset
when
jsType
==
JSTypeFlags
.
Missing
:
case
KnownManagedType
.
Object
when
jsType
==
JSTypeFlags
.
Missing
:
case
KnownManagedType
.
Object
when
jsType
==
JSTypeFlags
.
Missing
:
throw
failWithReason
(
string
.
Format
(
SR
.
UseJSMarshalAsAttribute
,
info
.
ManagedType
.
FullTypeName
));
throw
failWithReason
(
SR
.
Format
(
SR
.
UseJSMarshalAsAttribute
,
info
.
ManagedType
.
FullTypeName
));
// nullable
// nullable
case
KnownManagedType
.
Nullable
when
argumentTypes
[
0
]
==
KnownManagedType
.
Boolean
&&
jsType
==
JSTypeFlags
.
Boolean
:
return
new
NullableJSGenerator
(
MarshalerType
.
Boolean
);
case
KnownManagedType
.
Nullable
when
argumentTypes
[
0
]
==
KnownManagedType
.
Boolean
&&
jsType
==
JSTypeFlags
.
Boolean
:
return
new
NullableJSGenerator
(
MarshalerType
.
Boolean
);
...
@@ -157,10 +157,10 @@ internal static BaseJSGenerator Create(TypePositionInfo info, bool isToJs, Known
...
@@ -157,10 +157,10 @@ internal static BaseJSGenerator Create(TypePositionInfo info, bool isToJs, Known
case
KnownManagedType
.
Nullable
when
argumentTypes
[
0
]
==
KnownManagedType
.
Int64
&&
jsType
==
JSTypeFlags
.
Missing
:
case
KnownManagedType
.
Nullable
when
argumentTypes
[
0
]
==
KnownManagedType
.
Int64
&&
jsType
==
JSTypeFlags
.
Missing
:
case
KnownManagedType
.
Nullable
when
argumentTypes
[
0
]
==
KnownManagedType
.
DateTime
&&
jsType
==
JSTypeFlags
.
Missing
:
case
KnownManagedType
.
Nullable
when
argumentTypes
[
0
]
==
KnownManagedType
.
DateTime
&&
jsType
==
JSTypeFlags
.
Missing
:
case
KnownManagedType
.
Nullable
when
argumentTypes
[
0
]
==
KnownManagedType
.
DateTimeOffset
&&
jsType
==
JSTypeFlags
.
Missing
:
case
KnownManagedType
.
Nullable
when
argumentTypes
[
0
]
==
KnownManagedType
.
DateTimeOffset
&&
jsType
==
JSTypeFlags
.
Missing
:
throw
failWithReason
(
string
.
Format
(
SR
.
UseJSMarshalAsAttribute
,
info
.
ManagedType
.
FullTypeName
));
throw
failWithReason
(
SR
.
Format
(
SR
.
UseJSMarshalAsAttribute
,
info
.
ManagedType
.
FullTypeName
));
case
KnownManagedType
.
Nullable
:
case
KnownManagedType
.
Nullable
:
throw
failWithReason
(
string
.
Format
(
SR
.
TypeNotSupportedName
,
info
.
ManagedType
.
FullTypeName
));
throw
failWithReason
(
SR
.
Format
(
SR
.
TypeNotSupportedName
,
info
.
ManagedType
.
FullTypeName
));
// task
// task
case
KnownManagedType
.
Task
when
jsType
==
JSTypeFlags
.
Promise
&&
jsTypeArguments
.
Length
==
1
&&
argumentTypes
.
Length
==
0
&&
jsTypeArguments
[
0
]
==
JSTypeFlags
.
Void
:
return
new
TaskJSGenerator
(
MarshalerType
.
Void
);
case
KnownManagedType
.
Task
when
jsType
==
JSTypeFlags
.
Promise
&&
jsTypeArguments
.
Length
==
1
&&
argumentTypes
.
Length
==
0
&&
jsTypeArguments
[
0
]
==
JSTypeFlags
.
Void
:
return
new
TaskJSGenerator
(
MarshalerType
.
Void
);
...
@@ -200,10 +200,10 @@ internal static BaseJSGenerator Create(TypePositionInfo info, bool isToJs, Known
...
@@ -200,10 +200,10 @@ internal static BaseJSGenerator Create(TypePositionInfo info, bool isToJs, Known
case
KnownManagedType
.
Task
when
argumentTypes
[
0
]
==
KnownManagedType
.
DateTime
&&
jsType
==
JSTypeFlags
.
Missing
:
case
KnownManagedType
.
Task
when
argumentTypes
[
0
]
==
KnownManagedType
.
DateTime
&&
jsType
==
JSTypeFlags
.
Missing
:
case
KnownManagedType
.
Task
when
argumentTypes
[
0
]
==
KnownManagedType
.
DateTimeOffset
&&
jsType
==
JSTypeFlags
.
Missing
:
case
KnownManagedType
.
Task
when
argumentTypes
[
0
]
==
KnownManagedType
.
DateTimeOffset
&&
jsType
==
JSTypeFlags
.
Missing
:
case
KnownManagedType
.
Task
when
argumentTypes
[
0
]
==
KnownManagedType
.
Object
&&
jsType
==
JSTypeFlags
.
Missing
:
case
KnownManagedType
.
Task
when
argumentTypes
[
0
]
==
KnownManagedType
.
Object
&&
jsType
==
JSTypeFlags
.
Missing
:
throw
failWithReason
(
string
.
Format
(
SR
.
UseJSMarshalAsAttribute
,
info
.
ManagedType
.
FullTypeName
));
throw
failWithReason
(
SR
.
Format
(
SR
.
UseJSMarshalAsAttribute
,
info
.
ManagedType
.
FullTypeName
));
case
KnownManagedType
.
Task
when
jsType
==
JSTypeFlags
.
Promise
&&
jsTypeArguments
.
Length
==
1
:
case
KnownManagedType
.
Task
when
jsType
==
JSTypeFlags
.
Promise
&&
jsTypeArguments
.
Length
==
1
:
throw
failWithReason
(
string
.
Format
(
SR
.
TypeNotSupportedName
,
info
.
ManagedType
.
FullTypeName
));
throw
failWithReason
(
SR
.
Format
(
SR
.
TypeNotSupportedName
,
info
.
ManagedType
.
FullTypeName
));
// array
// array
case
KnownManagedType
.
Array
when
jsType
==
JSTypeFlags
.
Array
&&
jsTypeArguments
.
Length
==
1
&&
argumentTypes
[
0
]
==
KnownManagedType
.
Byte
&&
jsTypeArguments
[
0
]
==
JSTypeFlags
.
Number
:
return
new
ArrayJSGenerator
(
MarshalerType
.
Byte
);
case
KnownManagedType
.
Array
when
jsType
==
JSTypeFlags
.
Array
&&
jsTypeArguments
.
Length
==
1
&&
argumentTypes
[
0
]
==
KnownManagedType
.
Byte
&&
jsTypeArguments
[
0
]
==
JSTypeFlags
.
Number
:
return
new
ArrayJSGenerator
(
MarshalerType
.
Byte
);
...
@@ -220,11 +220,11 @@ internal static BaseJSGenerator Create(TypePositionInfo info, bool isToJs, Known
...
@@ -220,11 +220,11 @@ internal static BaseJSGenerator Create(TypePositionInfo info, bool isToJs, Known
case
KnownManagedType
.
Array
when
argumentTypes
[
0
]
==
KnownManagedType
.
Int32
&&
jsType
==
JSTypeFlags
.
Missing
:
return
new
ArrayJSGenerator
(
MarshalerType
.
Int32
);
case
KnownManagedType
.
Array
when
argumentTypes
[
0
]
==
KnownManagedType
.
Int32
&&
jsType
==
JSTypeFlags
.
Missing
:
return
new
ArrayJSGenerator
(
MarshalerType
.
Int32
);
case
KnownManagedType
.
Array
when
argumentTypes
[
0
]
==
KnownManagedType
.
JSObject
&&
jsType
==
JSTypeFlags
.
Missing
:
return
new
ArrayJSGenerator
(
MarshalerType
.
JSObject
);
case
KnownManagedType
.
Array
when
argumentTypes
[
0
]
==
KnownManagedType
.
JSObject
&&
jsType
==
JSTypeFlags
.
Missing
:
return
new
ArrayJSGenerator
(
MarshalerType
.
JSObject
);
case
KnownManagedType
.
Array
when
jsType
==
JSTypeFlags
.
Array
&&
jsTypeArguments
.
Length
==
1
:
case
KnownManagedType
.
Array
when
jsType
==
JSTypeFlags
.
Array
&&
jsTypeArguments
.
Length
==
1
:
throw
failWithReason
(
string
.
Format
(
SR
.
TypeNotSupportedName
,
info
.
ManagedType
.
FullTypeName
));
throw
failWithReason
(
SR
.
Format
(
SR
.
TypeNotSupportedName
,
info
.
ManagedType
.
FullTypeName
));
// array forced
// array forced
case
KnownManagedType
.
Array
when
argumentTypes
[
0
]
==
KnownManagedType
.
Object
&&
jsType
==
JSTypeFlags
.
Missing
:
case
KnownManagedType
.
Array
when
argumentTypes
[
0
]
==
KnownManagedType
.
Object
&&
jsType
==
JSTypeFlags
.
Missing
:
throw
failWithReason
(
string
.
Format
(
SR
.
UseJSMarshalAsAttribute
,
info
.
ManagedType
.
FullTypeName
));
throw
failWithReason
(
SR
.
Format
(
SR
.
UseJSMarshalAsAttribute
,
info
.
ManagedType
.
FullTypeName
));
// span view
// span view
case
KnownManagedType
.
Span
when
jsType
==
JSTypeFlags
.
MemoryView
&&
jsTypeArguments
.
Length
!=
0
:
case
KnownManagedType
.
Span
when
jsType
==
JSTypeFlags
.
MemoryView
&&
jsTypeArguments
.
Length
!=
0
:
...
@@ -234,13 +234,13 @@ internal static BaseJSGenerator Create(TypePositionInfo info, bool isToJs, Known
...
@@ -234,13 +234,13 @@ internal static BaseJSGenerator Create(TypePositionInfo info, bool isToJs, Known
case
KnownManagedType
.
Span
when
jsType
==
JSTypeFlags
.
MemoryView
&&
argumentTypes
[
0
]
==
KnownManagedType
.
Double
:
return
new
SpanJSGenerator
(
MarshalerType
.
Double
);
case
KnownManagedType
.
Span
when
jsType
==
JSTypeFlags
.
MemoryView
&&
argumentTypes
[
0
]
==
KnownManagedType
.
Double
:
return
new
SpanJSGenerator
(
MarshalerType
.
Double
);
case
KnownManagedType
.
Span
when
jsType
==
JSTypeFlags
.
MemoryView
:
case
KnownManagedType
.
Span
when
jsType
==
JSTypeFlags
.
MemoryView
:
throw
failWithReason
(
string
.
Format
(
SR
.
TypeNotSupportedName
,
info
.
ManagedType
.
FullTypeName
));
throw
failWithReason
(
SR
.
Format
(
SR
.
TypeNotSupportedName
,
info
.
ManagedType
.
FullTypeName
));
// span forced
// span forced
case
KnownManagedType
.
Span
when
argumentTypes
[
0
]
==
KnownManagedType
.
Byte
&&
jsType
==
JSTypeFlags
.
Missing
:
case
KnownManagedType
.
Span
when
argumentTypes
[
0
]
==
KnownManagedType
.
Byte
&&
jsType
==
JSTypeFlags
.
Missing
:
case
KnownManagedType
.
Span
when
argumentTypes
[
0
]
==
KnownManagedType
.
Int32
&&
jsType
==
JSTypeFlags
.
Missing
:
case
KnownManagedType
.
Span
when
argumentTypes
[
0
]
==
KnownManagedType
.
Int32
&&
jsType
==
JSTypeFlags
.
Missing
:
case
KnownManagedType
.
Span
when
argumentTypes
[
0
]
==
KnownManagedType
.
Double
&&
jsType
==
JSTypeFlags
.
Missing
:
case
KnownManagedType
.
Span
when
argumentTypes
[
0
]
==
KnownManagedType
.
Double
&&
jsType
==
JSTypeFlags
.
Missing
:
throw
failWithReason
(
string
.
Format
(
SR
.
UseJSMarshalAsAttribute
,
info
.
ManagedType
.
FullTypeName
));
throw
failWithReason
(
SR
.
Format
(
SR
.
UseJSMarshalAsAttribute
,
info
.
ManagedType
.
FullTypeName
));
// segment view
// segment view
case
KnownManagedType
.
ArraySegment
when
jsType
==
JSTypeFlags
.
MemoryView
&&
jsTypeArguments
.
Length
!=
0
:
case
KnownManagedType
.
ArraySegment
when
jsType
==
JSTypeFlags
.
MemoryView
&&
jsTypeArguments
.
Length
!=
0
:
...
@@ -249,13 +249,13 @@ internal static BaseJSGenerator Create(TypePositionInfo info, bool isToJs, Known
...
@@ -249,13 +249,13 @@ internal static BaseJSGenerator Create(TypePositionInfo info, bool isToJs, Known
case
KnownManagedType
.
ArraySegment
when
jsType
==
JSTypeFlags
.
MemoryView
&&
argumentTypes
[
0
]
==
KnownManagedType
.
Int32
:
return
new
ArraySegmentJSGenerator
(
MarshalerType
.
Int32
);
case
KnownManagedType
.
ArraySegment
when
jsType
==
JSTypeFlags
.
MemoryView
&&
argumentTypes
[
0
]
==
KnownManagedType
.
Int32
:
return
new
ArraySegmentJSGenerator
(
MarshalerType
.
Int32
);
case
KnownManagedType
.
ArraySegment
when
jsType
==
JSTypeFlags
.
MemoryView
&&
argumentTypes
[
0
]
==
KnownManagedType
.
Double
:
return
new
ArraySegmentJSGenerator
(
MarshalerType
.
Double
);
case
KnownManagedType
.
ArraySegment
when
jsType
==
JSTypeFlags
.
MemoryView
&&
argumentTypes
[
0
]
==
KnownManagedType
.
Double
:
return
new
ArraySegmentJSGenerator
(
MarshalerType
.
Double
);
case
KnownManagedType
.
ArraySegment
when
jsType
==
JSTypeFlags
.
MemoryView
:
case
KnownManagedType
.
ArraySegment
when
jsType
==
JSTypeFlags
.
MemoryView
:
throw
failWithReason
(
string
.
Format
(
SR
.
TypeNotSupportedName
,
info
.
ManagedType
.
FullTypeName
));
throw
failWithReason
(
SR
.
Format
(
SR
.
TypeNotSupportedName
,
info
.
ManagedType
.
FullTypeName
));
// segment forced
// segment forced
case
KnownManagedType
.
ArraySegment
when
argumentTypes
[
0
]
==
KnownManagedType
.
Byte
&&
jsType
==
JSTypeFlags
.
Missing
:
case
KnownManagedType
.
ArraySegment
when
argumentTypes
[
0
]
==
KnownManagedType
.
Byte
&&
jsType
==
JSTypeFlags
.
Missing
:
case
KnownManagedType
.
ArraySegment
when
argumentTypes
[
0
]
==
KnownManagedType
.
Int32
&&
jsType
==
JSTypeFlags
.
Missing
:
case
KnownManagedType
.
ArraySegment
when
argumentTypes
[
0
]
==
KnownManagedType
.
Int32
&&
jsType
==
JSTypeFlags
.
Missing
:
case
KnownManagedType
.
ArraySegment
when
argumentTypes
[
0
]
==
KnownManagedType
.
Double
&&
jsType
==
JSTypeFlags
.
Missing
:
case
KnownManagedType
.
ArraySegment
when
argumentTypes
[
0
]
==
KnownManagedType
.
Double
&&
jsType
==
JSTypeFlags
.
Missing
:
throw
failWithReason
(
string
.
Format
(
SR
.
UseJSMarshalAsAttribute
,
info
.
ManagedType
.
FullTypeName
));
throw
failWithReason
(
SR
.
Format
(
SR
.
UseJSMarshalAsAttribute
,
info
.
ManagedType
.
FullTypeName
));
// function + action
// function + action
case
KnownManagedType
.
Function
when
jsType
==
JSTypeFlags
.
Function
&&
jsTypeArguments
.
Length
==
argumentTypes
.
Length
:
case
KnownManagedType
.
Function
when
jsType
==
JSTypeFlags
.
Function
&&
jsTypeArguments
.
Length
==
argumentTypes
.
Length
:
...
@@ -273,7 +273,7 @@ internal static BaseJSGenerator Create(TypePositionInfo info, bool isToJs, Known
...
@@ -273,7 +273,7 @@ internal static BaseJSGenerator Create(TypePositionInfo info, bool isToJs, Known
||
argumentTypes
[
i
]
==
KnownManagedType
.
Unknown
||
argumentTypes
[
i
]
==
KnownManagedType
.
Unknown
)
)
{
{
throw
failWithReason
(
string
.
Format
(
SR
.
FuncArgumentNotSupported
,
argumentTypes
[
i
]));
throw
failWithReason
(
SR
.
Format
(
SR
.
FuncArgumentNotSupported
,
argumentTypes
[
i
]));
}
}
var
gen
=
Create
(
info
,
isToJs
^
(!
isReturn
),
argumentTypes
[
i
],
Array
.
Empty
<
KnownManagedType
>(),
jsTypeArguments
[
i
],
Array
.
Empty
<
JSTypeFlags
>(),
failWithReason
);
var
gen
=
Create
(
info
,
isToJs
^
(!
isReturn
),
argumentTypes
[
i
],
Array
.
Empty
<
KnownManagedType
>(),
jsTypeArguments
[
i
],
Array
.
Empty
<
JSTypeFlags
>(),
failWithReason
);
argsMarshalers
.
Add
(
gen
.
Type
);
argsMarshalers
.
Add
(
gen
.
Type
);
...
@@ -297,13 +297,13 @@ internal static BaseJSGenerator Create(TypePositionInfo info, bool isToJs, Known
...
@@ -297,13 +297,13 @@ internal static BaseJSGenerator Create(TypePositionInfo info, bool isToJs, Known
||
argumentTypes
[
i
]
==
KnownManagedType
.
Unknown
||
argumentTypes
[
i
]
==
KnownManagedType
.
Unknown
)
)
{
{
throw
failWithReason
(
string
.
Format
(
SR
.
FuncArgumentNotSupported
,
argumentTypes
[
i
]));
throw
failWithReason
(
SR
.
Format
(
SR
.
FuncArgumentNotSupported
,
argumentTypes
[
i
]));
}
}
}
}
throw
failWithReason
(
string
.
Format
(
SR
.
UseJSMarshalAsAttribute
,
info
.
ManagedType
.
FullTypeName
));
throw
failWithReason
(
SR
.
Format
(
SR
.
UseJSMarshalAsAttribute
,
info
.
ManagedType
.
FullTypeName
));
default
:
default
:
throw
failWithReason
(
string
.
Format
(
SR
.
TypeNotSupportedName
,
info
.
ManagedType
.
FullTypeName
));
throw
failWithReason
(
SR
.
Format
(
SR
.
TypeNotSupportedName
,
info
.
ManagedType
.
FullTypeName
));
}
}
}
}
}
}
...
...
src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/Analyzers/ConvertToLibraryImportFixer.cs
浏览文件 @
6d47f766
...
@@ -119,7 +119,7 @@ public CodeAction CreateConvertToLibraryImportCodeFix(Document document, MethodD
...
@@ -119,7 +119,7 @@ public CodeAction CreateConvertToLibraryImportCodeFix(Document document, MethodD
public
CodeAction
CreateConvertToLibraryImportWithSuffixCodeFix
(
Document
document
,
MethodDeclarationSyntax
methodSyntax
,
char
suffix
,
bool
mayRequireAdditionalWork
)
public
CodeAction
CreateConvertToLibraryImportWithSuffixCodeFix
(
Document
document
,
MethodDeclarationSyntax
methodSyntax
,
char
suffix
,
bool
mayRequireAdditionalWork
)
{
{
return
CodeAction
.
Create
(
return
CodeAction
.
Create
(
string
.
Format
(
SR
.
ConvertToLibraryImportWithSuffix
,
suffix
),
SR
.
Format
(
SR
.
ConvertToLibraryImportWithSuffix
,
suffix
),
cancelToken
=>
ConvertToLibraryImport
(
cancelToken
=>
ConvertToLibraryImport
(
document
,
document
,
methodSyntax
,
methodSyntax
,
...
@@ -155,7 +155,7 @@ public CodeAction CreateConvertToLibraryImportCodeFix(Document document, MethodD
...
@@ -155,7 +155,7 @@ public CodeAction CreateConvertToLibraryImportCodeFix(Document document, MethodD
public
CodeAction
CreateConvertToLibraryImportWithSuffixCodeFix
(
Document
document
,
MethodDeclarationSyntax
methodSyntax
,
char
suffix
,
bool
mayRequireAdditionalWork
)
public
CodeAction
CreateConvertToLibraryImportWithSuffixCodeFix
(
Document
document
,
MethodDeclarationSyntax
methodSyntax
,
char
suffix
,
bool
mayRequireAdditionalWork
)
{
{
return
CodeAction
.
Create
(
return
CodeAction
.
Create
(
string
.
Format
(
SR
.
ConvertToLibraryImportWithSuffixAddUnsafe
,
suffix
),
SR
.
Format
(
SR
.
ConvertToLibraryImportWithSuffixAddUnsafe
,
suffix
),
async
cancelToken
=>
async
cancelToken
=>
{
{
Solution
solutionWithUnsafe
=
AddUnsafe
(
document
.
Project
.
Solution
,
document
.
Project
);
Solution
solutionWithUnsafe
=
AddUnsafe
(
document
.
Project
.
Solution
,
document
.
Project
);
...
...
src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/AttributedMarshallingModelGeneratorFactory.cs
浏览文件 @
6d47f766
...
@@ -379,7 +379,7 @@ private void ValidateCustomNativeTypeMarshallingSupported(TypePositionInfo info,
...
@@ -379,7 +379,7 @@ private void ValidateCustomNativeTypeMarshallingSupported(TypePositionInfo info,
{
{
throw
new
MarshallingNotSupportedException
(
info
,
context
)
throw
new
MarshallingNotSupportedException
(
info
,
context
)
{
{
NotSupportedDetails
=
string
.
Format
(
SR
.
UnmanagedToManagedMissingRequiredMarshaller
,
marshalInfo
.
EntryPointType
.
FullTypeName
)
NotSupportedDetails
=
SR
.
Format
(
SR
.
UnmanagedToManagedMissingRequiredMarshaller
,
marshalInfo
.
EntryPointType
.
FullTypeName
)
};
};
}
}
...
@@ -388,7 +388,7 @@ private void ValidateCustomNativeTypeMarshallingSupported(TypePositionInfo info,
...
@@ -388,7 +388,7 @@ private void ValidateCustomNativeTypeMarshallingSupported(TypePositionInfo info,
{
{
throw
new
MarshallingNotSupportedException
(
info
,
context
)
throw
new
MarshallingNotSupportedException
(
info
,
context
)
{
{
NotSupportedDetails
=
string
.
Format
(
SR
.
BidirectionalMissingRequiredMarshaller
,
marshalInfo
.
EntryPointType
.
FullTypeName
)
NotSupportedDetails
=
SR
.
Format
(
SR
.
BidirectionalMissingRequiredMarshaller
,
marshalInfo
.
EntryPointType
.
FullTypeName
)
};
};
}
}
...
@@ -398,7 +398,7 @@ private void ValidateCustomNativeTypeMarshallingSupported(TypePositionInfo info,
...
@@ -398,7 +398,7 @@ private void ValidateCustomNativeTypeMarshallingSupported(TypePositionInfo info,
{
{
throw
new
MarshallingNotSupportedException
(
info
,
context
)
throw
new
MarshallingNotSupportedException
(
info
,
context
)
{
{
NotSupportedDetails
=
string
.
Format
(
SR
.
ManagedToUnmanagedMissingRequiredMarshaller
,
marshalInfo
.
EntryPointType
.
FullTypeName
)
NotSupportedDetails
=
SR
.
Format
(
SR
.
ManagedToUnmanagedMissingRequiredMarshaller
,
marshalInfo
.
EntryPointType
.
FullTypeName
)
};
};
}
}
...
@@ -410,7 +410,7 @@ private void ValidateCustomNativeTypeMarshallingSupported(TypePositionInfo info,
...
@@ -410,7 +410,7 @@ private void ValidateCustomNativeTypeMarshallingSupported(TypePositionInfo info,
{
{
throw
new
MarshallingNotSupportedException
(
info
,
context
)
throw
new
MarshallingNotSupportedException
(
info
,
context
)
{
{
NotSupportedDetails
=
string
.
Format
(
SR
.
ManagedToUnmanagedMissingRequiredMarshaller
,
marshalInfo
.
EntryPointType
.
FullTypeName
)
NotSupportedDetails
=
SR
.
Format
(
SR
.
ManagedToUnmanagedMissingRequiredMarshaller
,
marshalInfo
.
EntryPointType
.
FullTypeName
)
};
};
}
}
}
}
...
...
src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/CharMarshallingGeneratorFactory.cs
浏览文件 @
6d47f766
...
@@ -64,7 +64,7 @@ private IMarshallingGenerator CreateCharMarshaller(TypePositionInfo info, StubCo
...
@@ -64,7 +64,7 @@ private IMarshallingGenerator CreateCharMarshaller(TypePositionInfo info, StubCo
case
CharEncoding
.
Utf8
:
case
CharEncoding
.
Utf8
:
throw
new
MarshallingNotSupportedException
(
info
,
context
)
// [Compat] UTF-8 is not supported for char
throw
new
MarshallingNotSupportedException
(
info
,
context
)
// [Compat] UTF-8 is not supported for char
{
{
NotSupportedDetails
=
string
.
Format
(
SR
.
MarshallingCharAsSpecifiedStringMarshallingNotSupported
,
nameof
(
CharEncoding
.
Utf8
))
NotSupportedDetails
=
SR
.
Format
(
SR
.
MarshallingCharAsSpecifiedStringMarshallingNotSupported
,
nameof
(
CharEncoding
.
Utf8
))
};
};
case
CharEncoding
.
Custom
:
case
CharEncoding
.
Custom
:
throw
new
MarshallingNotSupportedException
(
info
,
context
)
throw
new
MarshallingNotSupportedException
(
info
,
context
)
...
...
src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs
浏览文件 @
6d47f766
...
@@ -1218,7 +1218,7 @@ private static string EscapeAscii(string path)
...
@@ -1218,7 +1218,7 @@ private static string EscapeAscii(string path)
builder
.
Append
(
c
);
builder
.
Append
(
c
);
break
;
break
;
default
:
default
:
builder
.
Append
(
string
.
Format
(
$"%
{((
int
)
c
):
X2
}
"
)
);
builder
.
Append
Format
(
"%{0:X2}"
,
(
int
)
c
);
break
;
break
;
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录