Skip to content

Commit c13383a

Browse files
author
Kanchalai Tanglertsampan
committed
Fix baselines and linting error from merging with master
1 parent f6f0813 commit c13383a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/compiler/checker.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8696,10 +8696,10 @@ namespace ts {
86968696
// type, a property is considered known if it is known in any constituent type.
86978697
function isKnownProperty(type: Type, name: string, isComparingJsxAttributes: boolean): boolean {
86988698
if (type.flags & TypeFlags.Object) {
8699-
const resolved = resolveStructuredTypeMembers(<ObjectType>type);
8699+
const resolved = resolveStructuredTypeMembers(<ObjectType>type);
87008700
if (resolved.stringIndexInfo || resolved.numberIndexInfo && isNumericLiteralName(name) ||
87018701
getPropertyOfType(type, name) || isComparingJsxAttributes && !isUnhyphenatedJsxName(name)) {
8702-
// For JSXAttributes, if the attribute has a hyphenated name, consider that the attribute to be known.
8702+
// For JSXAttributes, if the attribute has a hyphenated name, consider that the attribute to be known.
87038703
return true;
87048704
}
87058705
}
@@ -13477,7 +13477,7 @@ namespace ts {
1347713477
function getPropertiesFromJsxElementAttributesProperty() {
1347813478
if (!_jsxElementAttribPropInterfaceSymbol) {
1347913479
// JSX
13480-
const jsxNamespace = getGlobalSymbol(JsxNames.JSX, SymbolFlags.Namespace, /*diagnosticMessage*/undefined);
13480+
const jsxNamespace = getGlobalSymbol(JsxNames.JSX, SymbolFlags.Namespace, /*diagnosticMessage*/ undefined);
1348113481
// JSX.ElementAttributesProperty [symbol]
1348213482
_jsxElementAttribPropInterfaceSymbol = jsxNamespace && getSymbol(jsxNamespace.exports, JsxNames.ElementAttributesPropertyNameContainer, SymbolFlags.Type);
1348313483
}

tests/baselines/reference/checkJsxChildrenProperty2.errors.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
tests/cases/conformance/jsx/file.tsx(14,15): error TS2322: Type '{ a: 10; b: "hi"; }' is not assignable to type 'IntrinsicAttributes & Prop'.
22
Type '{ a: 10; b: "hi"; }' is not assignable to type 'Prop'.
33
Property 'children' is missing in type '{ a: 10; b: "hi"; }'.
4-
tests/cases/conformance/jsx/file.tsx(17,11): error TS2708: 'children' are specified twice. The attribute named 'children' will be overwritten.
5-
tests/cases/conformance/jsx/file.tsx(25,11): error TS2708: 'children' are specified twice. The attribute named 'children' will be overwritten.
4+
tests/cases/conformance/jsx/file.tsx(17,11): error TS2710: 'children' are specified twice. The attribute named 'children' will be overwritten.
5+
tests/cases/conformance/jsx/file.tsx(25,11): error TS2710: 'children' are specified twice. The attribute named 'children' will be overwritten.
66
tests/cases/conformance/jsx/file.tsx(31,11): error TS2322: Type '{ a: 10; b: "hi"; children: (Element | ((name: string) => Element))[]; }' is not assignable to type 'IntrinsicAttributes & Prop'.
77
Type '{ a: 10; b: "hi"; children: (Element | ((name: string) => Element))[]; }' is not assignable to type 'Prop'.
88
Types of property 'children' are incompatible.
@@ -52,7 +52,7 @@ tests/cases/conformance/jsx/file.tsx(49,11): error TS2322: Type '{ a: 10; b: "hi
5252
let k0 =
5353
<Comp a={10} b="hi" children="Random" >
5454
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
55-
!!! error TS2708: 'children' are specified twice. The attribute named 'children' will be overwritten.
55+
!!! error TS2710: 'children' are specified twice. The attribute named 'children' will be overwritten.
5656
hi hi hi!
5757
</Comp>;
5858

@@ -62,7 +62,7 @@ tests/cases/conformance/jsx/file.tsx(49,11): error TS2322: Type '{ a: 10; b: "hi
6262
let k1 =
6363
<Comp a={10} b="hi" {...o} >
6464
~~~~~~~~~~~~~~~~~~~~
65-
!!! error TS2708: 'children' are specified twice. The attribute named 'children' will be overwritten.
65+
!!! error TS2710: 'children' are specified twice. The attribute named 'children' will be overwritten.
6666
hi hi hi!
6767
</Comp>;
6868

0 commit comments

Comments
 (0)