Merge branch 'master' into fix-implement-interface-with-extends-class

This commit is contained in:
王文璐
2018-05-30 09:05:56 +08:00
112 changed files with 1302 additions and 762 deletions
+2 -2
View File
@@ -52,8 +52,8 @@ function walk(ctx: Lint.WalkContext<void>, checkCatch: boolean, checkElse: boole
return;
}
const tryClosingBrace = tryBlock.getLastToken(sourceFile);
const catchKeyword = catchClause.getFirstToken(sourceFile);
const tryClosingBrace = tryBlock.getLastToken(sourceFile)!;
const catchKeyword = catchClause.getFirstToken(sourceFile)!;
const tryClosingBraceLoc = sourceFile.getLineAndCharacterOfPosition(tryClosingBrace.getEnd());
const catchKeywordLoc = sourceFile.getLineAndCharacterOfPosition(catchKeyword.getStart(sourceFile));
if (tryClosingBraceLoc.line === catchKeywordLoc.line) {
+1 -1
View File
@@ -12,7 +12,7 @@ export class Rule extends Lint.Rules.AbstractRule {
function walk(ctx: Lint.WalkContext<void>): void {
ts.forEachChild(ctx.sourceFile, recur);
function recur(node: ts.Node): void {
if (node.kind === ts.SyntaxKind.InKeyword && node.parent!.kind === ts.SyntaxKind.BinaryExpression) {
if (node.kind === ts.SyntaxKind.InKeyword && node.parent.kind === ts.SyntaxKind.BinaryExpression) {
ctx.addFailureAtNode(node, Rule.FAILURE_STRING);
}
}
@@ -28,7 +28,7 @@ function walk(ctx: Lint.WalkContext<void>): void {
}
function check(node: ts.UnaryExpression): void {
if (!isAllowedLocation(node.parent!)) {
if (!isAllowedLocation(node.parent)) {
ctx.addFailureAtNode(node, Rule.POSTFIX_FAILURE_STRING);
}
}
@@ -47,7 +47,7 @@ function isAllowedLocation(node: ts.Node): boolean {
// Can be in a comma operator in a for statement (`for (let a = 0, b = 10; a < b; a++, b--)`)
case ts.SyntaxKind.BinaryExpression:
return (node as ts.BinaryExpression).operatorToken.kind === ts.SyntaxKind.CommaToken &&
node.parent!.kind === ts.SyntaxKind.ForStatement;
node.parent.kind === ts.SyntaxKind.ForStatement;
default:
return false;
+13 -3
View File
@@ -10592,6 +10592,16 @@ namespace ts {
else if (source.symbol && source.flags & TypeFlags.Object && globalObjectType === source) {
reportError(Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
}
else if (getObjectFlags(source) & ObjectFlags.JsxAttributes && target.flags & TypeFlags.Intersection) {
const targetTypes = (target as IntersectionType).types;
const intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
const intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
if (intrinsicAttributes !== unknownType && intrinsicClassAttributes !== unknownType &&
(contains(targetTypes, intrinsicAttributes) || contains(targetTypes, intrinsicClassAttributes))) {
// do not report top error
return result;
}
}
reportRelationError(headMessage, source, target);
}
return result;
@@ -16274,7 +16284,7 @@ namespace ts {
return createJsxAttributesTypeFromAttributesProperty(node.parent, checkMode);
}
function getJsxType(name: __String, location: Node) {
function getJsxType(name: __String, location: Node | undefined) {
const namespace = getJsxNamespaceAt(location);
const exports = namespace && getExportsOfSymbol(namespace);
const typeSymbol = exports && getSymbol(exports, name, SymbolFlags.Type);
@@ -16372,7 +16382,7 @@ namespace ts {
return getSignatureInstantiation(signature, args, isJavascript);
}
function getJsxNamespaceAt(location: Node): Symbol {
function getJsxNamespaceAt(location: Node | undefined): Symbol {
const namespaceName = getJsxNamespace(location);
const resolvedNamespace = resolveName(location, namespaceName, SymbolFlags.Namespace, /*diagnosticMessage*/ undefined, namespaceName, /*isUse*/ false);
if (resolvedNamespace) {
@@ -20418,7 +20428,7 @@ namespace ts {
if (propType.symbol && propType.symbol.flags & SymbolFlags.Class) {
const name = prop.escapedName;
const symbol = resolveName(prop.valueDeclaration, name, SymbolFlags.Type, undefined, name, /*isUse*/ false);
if (symbol) {
if (symbol && propType.symbol !== symbol) {
grammarErrorOnNode(symbol.declarations[0], Diagnostics.Duplicate_identifier_0, unescapeLeadingUnderscores(name));
return grammarErrorOnNode(prop.valueDeclaration, Diagnostics.Duplicate_identifier_0, unescapeLeadingUnderscores(name));
}
+1 -1
View File
@@ -416,7 +416,7 @@ namespace ts {
createLogicalNot(getDone)
),
/*incrementor*/ undefined,
/*statement*/ convertForOfStatementHead(node, createDownlevelAwait(getValue))
/*statement*/ convertForOfStatementHead(node, getValue)
),
/*location*/ node
),
+2 -2
View File
@@ -3252,8 +3252,8 @@ namespace ts {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
+1 -1
View File
@@ -868,7 +868,7 @@ namespace FourSlash {
for (const entry of actualCompletions.entries) {
if (actualByName.has(entry.name)) {
// TODO: GH#23587
if (entry.name !== "undefined" && entry.name !== "require") this.raiseError(`Duplicate completions for ${entry.name}`);
if (entry.name !== "undefined" && entry.name !== "require") this.raiseError(`Duplicate (${actualCompletions.entries.filter(a => a.name === entry.name).length}) completions for ${entry.name}`);
}
else {
actualByName.set(entry.name, entry);
@@ -0,0 +1,148 @@
/// <reference path="..\harness.ts" />
namespace ts {
declare var Symbol: SymbolConstructor;
describe("forAwaitOfEvaluation", () => {
const sourceFile = vpath.combine(vfs.srcFolder, "source.ts");
function compile(sourceText: string, options?: CompilerOptions) {
const fs = vfs.createFromFileSystem(Harness.IO, /*ignoreCase*/ false);
fs.writeFileSync(sourceFile, sourceText);
const compilerOptions: CompilerOptions = { target: ScriptTarget.ES5, module: ModuleKind.CommonJS, lib: ["lib.esnext.d.ts"], ...options };
const host = new fakes.CompilerHost(fs, compilerOptions);
return compiler.compileFiles(host, [sourceFile], compilerOptions);
}
function noRequire(id: string) {
throw new Error(`Module '${id}' could not be found.`);
}
// Define a custom "Symbol" constructor to attach missing built-in symbols without
// modifying the global "Symbol" constructor
// tslint:disable-next-line:variable-name
const FakeSymbol: SymbolConstructor = ((description?: string) => Symbol(description)) as any;
(<any>FakeSymbol).prototype = Symbol.prototype;
for (const key of Object.getOwnPropertyNames(Symbol)) {
Object.defineProperty(FakeSymbol, key, Object.getOwnPropertyDescriptor(Symbol, key)!);
}
// Add "asyncIterator" if missing
if (!hasProperty(FakeSymbol, "asyncIterator")) Object.defineProperty(FakeSymbol, "asyncIterator", { value: Symbol.for("Symbol.asyncIterator"), configurable: true });
function evaluate(result: compiler.CompilationResult) {
const output = result.getOutput(sourceFile, "js")!;
assert.isDefined(output);
const evaluateText = `(function (module, exports, require, __dirname, __filename, Symbol) { ${output.text} })`;
const evaluateThunk = eval(evaluateText) as (module: any, exports: any, require: (id: string) => any, dirname: string, filename: string, symbolConstructor: SymbolConstructor) => void;
const module: { exports: any; } = { exports: {} };
evaluateThunk(module, module.exports, noRequire, vpath.dirname(output.file), output.file, FakeSymbol);
return module;
}
it("sync (es5)", async () => {
const module = evaluate(compile(`
let i = 0;
const iterator = {
[Symbol.iterator]() { return this; },
next() {
switch (i++) {
case 0: return { value: 1, done: false };
case 1: return { value: Promise.resolve(2), done: false };
case 2: return { value: new Promise<number>(resolve => setTimeout(resolve, 100, 3)), done: false };
default: return { value: undefined: done: true };
}
}
};
export const output: any[] = [];
export async function main() {
for await (const item of iterator) {
output.push(item);
}
}`));
await module.exports.main();
assert.strictEqual(module.exports.output[0], 1);
assert.strictEqual(module.exports.output[1], 2);
assert.strictEqual(module.exports.output[2], 3);
});
it("sync (es2015)", async () => {
const module = evaluate(compile(`
let i = 0;
const iterator = {
[Symbol.iterator]() { return this; },
next() {
switch (i++) {
case 0: return { value: 1, done: false };
case 1: return { value: Promise.resolve(2), done: false };
case 2: return { value: new Promise<number>(resolve => setTimeout(resolve, 100, 3)), done: false };
default: return { value: undefined: done: true };
}
}
};
export const output: any[] = [];
export async function main() {
for await (const item of iterator) {
output.push(item);
}
}`, { target: ScriptTarget.ES2015 }));
await module.exports.main();
assert.strictEqual(module.exports.output[0], 1);
assert.strictEqual(module.exports.output[1], 2);
assert.strictEqual(module.exports.output[2], 3);
});
it("async (es5)", async () => {
const module = evaluate(compile(`
let i = 0;
const iterator = {
[Symbol.asyncIterator]() { return this; },
async next() {
switch (i++) {
case 0: return { value: 1, done: false };
case 1: return { value: Promise.resolve(2), done: false };
case 2: return { value: new Promise<number>(resolve => setTimeout(resolve, 100, 3)), done: false };
default: return { value: undefined: done: true };
}
}
};
export const output: any[] = [];
export async function main() {
for await (const item of iterator) {
output.push(item);
}
}`));
await module.exports.main();
assert.strictEqual(module.exports.output[0], 1);
assert.instanceOf(module.exports.output[1], Promise);
assert.instanceOf(module.exports.output[2], Promise);
});
it("async (es2015)", async () => {
const module = evaluate(compile(`
let i = 0;
const iterator = {
[Symbol.asyncIterator]() { return this; },
async next() {
switch (i++) {
case 0: return { value: 1, done: false };
case 1: return { value: Promise.resolve(2), done: false };
case 2: return { value: new Promise<number>(resolve => setTimeout(resolve, 100, 3)), done: false };
default: return { value: undefined: done: true };
}
}
};
export const output: any[] = [];
export async function main() {
for await (const item of iterator) {
output.push(item);
}
}`, { target: ScriptTarget.ES2015 }));
await module.exports.main();
assert.strictEqual(module.exports.output[0], 1);
assert.instanceOf(module.exports.output[1], Promise);
assert.instanceOf(module.exports.output[2], Promise);
});
});
}
@@ -2394,6 +2394,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 with module {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[使用模块 {0} 将目标设置为 ES5 时,类名称不能为 "Object"。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class static side '{0}' incorrectly extends base class static side '{1}'.]]></Val>
@@ -2559,6 +2568,9 @@
<Item ItemId=";Convert_0_to_mapped_object_type_95055" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert '{0}' to mapped object type]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[将“{0}”转换为映射对象类型]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2394,6 +2394,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 with module {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[當目標為具有模組 {0} 的 ES5 時,類別名稱不可為 'Object'。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class static side '{0}' incorrectly extends base class static side '{1}'.]]></Val>
@@ -2556,6 +2565,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_0_to_mapped_object_type_95055" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert '{0}' to mapped object type]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[將 '{0}' 轉換為對應的物件類型]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_all_constructor_functions_to_classes_95045" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert all constructor functions to classes]]></Val>
@@ -2403,6 +2403,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 with module {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Když se cílí na ES5 s modulem {0}, název třídy nemůže být Object.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class static side '{0}' incorrectly extends base class static side '{1}'.]]></Val>
@@ -2568,6 +2577,9 @@
<Item ItemId=";Convert_0_to_mapped_object_type_95055" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert '{0}' to mapped object type]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Převést {0} na typ mapovaného objektu]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2391,6 +2391,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 with module {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Der Klassenname darf nicht "Object" lauten, wenn ES5 mit Modul "{0}" als Ziel verwendet wird.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class static side '{0}' incorrectly extends base class static side '{1}'.]]></Val>
@@ -2556,6 +2565,9 @@
<Item ItemId=";Convert_0_to_mapped_object_type_95055" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert '{0}' to mapped object type]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA["{0}" in zugeordneten Objekttyp konvertieren]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2406,6 +2406,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 with module {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Le nom de la classe ne peut pas être 'Object' quand ES5 est ciblé avec le module {0}.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class static side '{0}' incorrectly extends base class static side '{1}'.]]></Val>
@@ -2568,6 +2577,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_0_to_mapped_object_type_95055" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert '{0}' to mapped object type]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Convertir '{0}' en type d'objet mappé]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_all_constructor_functions_to_classes_95045" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert all constructor functions to classes]]></Val>
@@ -2394,6 +2394,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 with module {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Il nome della classe non può essere 'Object' quando la destinazione è ES5 con il modulo {0}.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class static side '{0}' incorrectly extends base class static side '{1}'.]]></Val>
@@ -2559,6 +2568,9 @@
<Item ItemId=";Convert_0_to_mapped_object_type_95055" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert '{0}' to mapped object type]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Convertire '{0}' nel tipo di oggetto con mapping]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2394,6 +2394,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 with module {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[{0} 모듈을 사용하는 ES5를 대상으로 하는 경우 클래스 이름은 'Object'일 수 없습니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class static side '{0}' incorrectly extends base class static side '{1}'.]]></Val>
@@ -2559,6 +2568,9 @@
<Item ItemId=";Convert_0_to_mapped_object_type_95055" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert '{0}' to mapped object type]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}'을(를) 매핑된 개체 형식으로 변환]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2384,6 +2384,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 with module {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Nazwą klasy nie może być słowo „Object”, gdy docelowym językiem jest ES5 z modułem {0}.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class static side '{0}' incorrectly extends base class static side '{1}'.]]></Val>
@@ -2549,6 +2558,9 @@
<Item ItemId=";Convert_0_to_mapped_object_type_95055" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert '{0}' to mapped object type]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Konwertuj element „{0}” na zamapowany typ obiektu]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2393,6 +2393,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 with module {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Класс не может иметь имя "Object" при выборе ES5 с модулем {0} в качестве целевого.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class static side '{0}' incorrectly extends base class static side '{1}'.]]></Val>
@@ -2555,6 +2564,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_0_to_mapped_object_type_95055" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert '{0}' to mapped object type]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Преобразовать "{0}" в тип сопоставленного объекта]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_all_constructor_functions_to_classes_95045" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert all constructor functions to classes]]></Val>
@@ -2387,6 +2387,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 with module {0}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Modül {0} ile ES5 hedeflendiğinde sınıf adı 'Object' olamaz.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class static side '{0}' incorrectly extends base class static side '{1}'.]]></Val>
@@ -2552,6 +2561,9 @@
<Item ItemId=";Convert_0_to_mapped_object_type_95055" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert '{0}' to mapped object type]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}' öğesini eşlenen nesne türüne dönüştür]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
+46 -14
View File
@@ -14,7 +14,8 @@ namespace ts.codefix {
registerCodeFix({
errorCodes,
getCodeActions(context) {
const { errorCode, sourceFile } = context;
const { errorCode, sourceFile, program } = context;
const checker = program.getTypeChecker();
const startToken = getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false);
const importDecl = tryGetFullImport(startToken);
@@ -22,7 +23,7 @@ namespace ts.codefix {
const changes = textChanges.ChangeTracker.with(context, t => t.deleteNode(sourceFile, importDecl));
return [createCodeFixAction(fixName, changes, [Diagnostics.Remove_import_from_0, showModuleSpecifier(importDecl)], fixIdDelete, Diagnostics.Delete_all_unused_declarations)];
}
const delDestructure = textChanges.ChangeTracker.with(context, t => tryDeleteFullDestructure(t, sourceFile, startToken, /*deleted*/ undefined));
const delDestructure = textChanges.ChangeTracker.with(context, t => tryDeleteFullDestructure(t, sourceFile, startToken, /*deleted*/ undefined, checker, /*isFixAll*/ false));
if (delDestructure.length) {
return [createCodeFixAction(fixName, delDestructure, Diagnostics.Remove_destructuring, fixIdDelete, Diagnostics.Delete_all_unused_declarations)];
}
@@ -34,7 +35,7 @@ namespace ts.codefix {
const token = getToken(sourceFile, textSpanEnd(context.span));
const result: CodeFixAction[] = [];
const deletion = textChanges.ChangeTracker.with(context, t => tryDeleteDeclaration(t, sourceFile, token, /*deleted*/ undefined));
const deletion = textChanges.ChangeTracker.with(context, t => tryDeleteDeclaration(t, sourceFile, token, /*deleted*/ undefined, checker, /*isFixAll*/ false));
if (deletion.length) {
result.push(createCodeFixAction(fixName, deletion, [Diagnostics.Remove_declaration_for_Colon_0, token.getText(sourceFile)], fixIdDelete, Diagnostics.Delete_all_unused_declarations));
}
@@ -50,8 +51,9 @@ namespace ts.codefix {
getAllCodeActions: context => {
// Track a set of deleted nodes that may be ancestors of other marked for deletion -- only delete the ancestors.
const deleted = new NodeSet();
const { sourceFile, program } = context;
const checker = program.getTypeChecker();
return codeFixAll(context, errorCodes, (changes, diag) => {
const { sourceFile } = context;
const startToken = getTokenAtPosition(sourceFile, diag.start, /*includeJsDocComment*/ false);
const token = findPrecedingToken(textSpanEnd(diag), diag.file)!;
switch (context.fixId) {
@@ -68,8 +70,9 @@ namespace ts.codefix {
if (importDecl) {
changes.deleteNode(sourceFile, importDecl);
}
else if (!tryDeleteFullDestructure(changes, sourceFile, startToken, deleted) && !tryDeleteFullVariableStatement(changes, sourceFile, startToken, deleted)) {
tryDeleteDeclaration(changes, sourceFile, token, deleted);
else if (!tryDeleteFullDestructure(changes, sourceFile, startToken, deleted, checker, /*isFixAll*/ true) &&
!tryDeleteFullVariableStatement(changes, sourceFile, startToken, deleted)) {
tryDeleteDeclaration(changes, sourceFile, token, deleted, checker, /*isFixAll*/ true);
}
break;
default:
@@ -84,7 +87,7 @@ namespace ts.codefix {
return startToken.kind === SyntaxKind.ImportKeyword ? tryCast(startToken.parent, isImportDeclaration) : undefined;
}
function tryDeleteFullDestructure(changes: textChanges.ChangeTracker, sourceFile: SourceFile, startToken: Node, deletedAncestors: NodeSet | undefined): boolean {
function tryDeleteFullDestructure(changes: textChanges.ChangeTracker, sourceFile: SourceFile, startToken: Node, deletedAncestors: NodeSet | undefined, checker: TypeChecker, isFixAll: boolean): boolean {
if (startToken.kind !== SyntaxKind.OpenBraceToken || !isObjectBindingPattern(startToken.parent)) return false;
const decl = cast(startToken.parent, isObjectBindingPattern).parent;
switch (decl.kind) {
@@ -92,6 +95,7 @@ namespace ts.codefix {
tryDeleteVariableDeclaration(changes, sourceFile, decl, deletedAncestors);
break;
case SyntaxKind.Parameter:
if (!mayDeleteParameter(decl, checker, isFixAll)) break;
if (deletedAncestors) deletedAncestors.add(decl);
changes.deleteNodeInList(sourceFile, decl);
break;
@@ -144,10 +148,10 @@ namespace ts.codefix {
return false;
}
function tryDeleteDeclaration(changes: textChanges.ChangeTracker, sourceFile: SourceFile, token: Node, deletedAncestors: NodeSet | undefined): void {
function tryDeleteDeclaration(changes: textChanges.ChangeTracker, sourceFile: SourceFile, token: Node, deletedAncestors: NodeSet | undefined, checker: TypeChecker, isFixAll: boolean): void {
switch (token.kind) {
case SyntaxKind.Identifier:
tryDeleteIdentifier(changes, sourceFile, <Identifier>token, deletedAncestors);
tryDeleteIdentifier(changes, sourceFile, <Identifier>token, deletedAncestors, checker, isFixAll);
break;
case SyntaxKind.PropertyDeclaration:
case SyntaxKind.NamespaceImport:
@@ -170,7 +174,7 @@ namespace ts.codefix {
}
}
function tryDeleteIdentifier(changes: textChanges.ChangeTracker, sourceFile: SourceFile, identifier: Identifier, deletedAncestors: NodeSet | undefined): void {
function tryDeleteIdentifier(changes: textChanges.ChangeTracker, sourceFile: SourceFile, identifier: Identifier, deletedAncestors: NodeSet | undefined, checker: TypeChecker, isFixAll: boolean): void {
const parent = identifier.parent;
switch (parent.kind) {
case SyntaxKind.VariableDeclaration:
@@ -194,11 +198,8 @@ namespace ts.codefix {
break;
case SyntaxKind.Parameter:
if (!mayDeleteParameter(parent as ParameterDeclaration, checker, isFixAll)) break;
const oldFunction = parent.parent;
if (isSetAccessor(oldFunction)) {
// Setter must have a parameter
break;
}
if (isArrowFunction(oldFunction) && oldFunction.parameters.length === 1) {
// Lambdas with exactly one parameter are special because, after removal, there
@@ -347,4 +348,35 @@ namespace ts.codefix {
}
}
}
function mayDeleteParameter(p: ParameterDeclaration, checker: TypeChecker, isFixAll: boolean) {
const parent = p.parent;
switch (parent.kind) {
case SyntaxKind.MethodDeclaration:
// Don't remove a parameter if this overrides something
const symbol = checker.getSymbolAtLocation(parent.name)!;
if (isMemberSymbolInBaseType(symbol, checker)) return false;
// falls through
case SyntaxKind.Constructor:
case SyntaxKind.FunctionDeclaration:
case SyntaxKind.FunctionExpression:
case SyntaxKind.ArrowFunction: {
// Can't remove a non-last parameter. Can remove a parameter in code-fix-all if future parameters are also unused.
const { parameters } = parent;
const index = parameters.indexOf(p);
Debug.assert(index !== -1);
return isFixAll
? parameters.slice(index + 1).every(p => p.name.kind === SyntaxKind.Identifier && !p.symbol.isReferenced)
: index === parameters.length - 1;
}
case SyntaxKind.SetAccessor:
// Setter must have a parameter
return false;
default:
return Debug.failBadSyntaxKind(parent);
}
}
}
+15 -22
View File
@@ -16,15 +16,18 @@ namespace ts.moduleSpecifiers {
const getCanonicalFileName = hostGetCanonicalFileName(host);
const sourceDirectory = getDirectoryPath(importingSourceFile.fileName);
return getAllModulePaths(program, moduleSymbol.valueDeclaration.getSourceFile()).map(moduleFileName => {
const global = tryGetModuleNameFromAmbientModule(moduleSymbol)
|| tryGetModuleNameFromTypeRoots(compilerOptions, host, getCanonicalFileName, moduleFileName, addJsExtension)
|| tryGetModuleNameAsNodeModule(compilerOptions, moduleFileName, host, getCanonicalFileName, sourceDirectory)
|| rootDirs && tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName);
if (global) {
return [global];
}
const ambient = tryGetModuleNameFromAmbientModule(moduleSymbol);
if (ambient) return [[ambient]];
const modulePaths = getAllModulePaths(program, moduleSymbol.valueDeclaration.getSourceFile());
const global = mapDefined(modulePaths, moduleFileName =>
tryGetModuleNameFromTypeRoots(compilerOptions, host, getCanonicalFileName, moduleFileName, addJsExtension) ||
tryGetModuleNameAsNodeModule(compilerOptions, moduleFileName, host, getCanonicalFileName, sourceDirectory) ||
rootDirs && tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName));
if (global.length) return global.map(g => [g]);
return modulePaths.map(moduleFileName => {
const relativePath = removeExtensionAndIndexPostFix(ensurePathIsNonModuleName(getRelativePathFromDirectory(sourceDirectory, moduleFileName, getCanonicalFileName)), moduleResolutionKind, addJsExtension);
if (!baseUrl || preferences.importModuleSpecifierPreference === "relative") {
return [relativePath];
@@ -191,11 +194,12 @@ namespace ts.moduleSpecifiers {
// Simplify the full file path to something that can be resolved by Node.
// If the module could be imported by a directory name, use that directory's name
let moduleSpecifier = getDirectoryOrExtensionlessFileName(moduleFileName);
const moduleSpecifier = getDirectoryOrExtensionlessFileName(moduleFileName);
// Get a path that's relative to node_modules or the importing file's path
moduleSpecifier = getNodeResolvablePath(moduleSpecifier);
// if node_modules folder is in this folder or any of its parent folders, no need to keep it.
if (!startsWith(sourceDirectory, moduleSpecifier.substring(0, parts.topLevelNodeModulesIndex))) return undefined;
// If the module was found in @types, get the actual Node package name
return getPackageNameFromAtTypesDirectory(moduleSpecifier);
return getPackageNameFromAtTypesDirectory(moduleSpecifier.substring(parts.topLevelPackageNameIndex + 1));
function getDirectoryOrExtensionlessFileName(path: string): string {
// If the file is the main module, it can be imported by the package name
@@ -224,17 +228,6 @@ namespace ts.moduleSpecifiers {
return fullModulePathWithoutExtension;
}
function getNodeResolvablePath(path: string): string {
const basePath = path.substring(0, parts.topLevelNodeModulesIndex);
if (sourceDirectory.indexOf(basePath) === 0) {
// if node_modules folder is in this folder or any of its parent folders, no need to keep it.
return path.substring(parts.topLevelPackageNameIndex + 1);
}
else {
return ensurePathIsNonModuleName(getRelativePathFromDirectory(sourceDirectory, path, getCanonicalFileName));
}
}
}
interface NodeModulePathParts {
+9 -1
View File
@@ -1320,12 +1320,20 @@ namespace ts.Completions {
function getSymbolsFromOtherSourceFileExports(symbols: Symbol[], tokenText: string, target: ScriptTarget): void {
const tokenTextLowerCase = tokenText.toLowerCase();
const seenResolvedModules = createMap<true>();
codefix.forEachExternalModuleToImportFrom(typeChecker, sourceFile, program.getSourceFiles(), moduleSymbol => {
// Perf -- ignore other modules if this is a request for details
if (detailsEntryId && detailsEntryId.source && stripQuotes(moduleSymbol.name) !== detailsEntryId.source) {
return;
}
const resolvedModuleSymbol = typeChecker.resolveExternalModuleSymbol(moduleSymbol);
// resolvedModuleSymbol may be a namespace. A namespace may be `export =` by multiple module declarations, but only keep the first one.
if (!addToSeen(seenResolvedModules, getSymbolId(resolvedModuleSymbol))) {
return;
}
for (let symbol of typeChecker.getExportsOfModule(moduleSymbol)) {
// Don't add a completion for a re-export, only for the original.
// The actual import fix might end up coming from a re-export -- we don't compute that until getting completion details.
@@ -1333,7 +1341,7 @@ namespace ts.Completions {
//
// If `symbol.parent !== ...`, this comes from an `export * from "foo"` re-export. Those don't create new symbols.
// If `some(...)`, this comes from an `export { foo } from "foo"` re-export, which creates a new symbol (thus isn't caught by the first check).
if (typeChecker.getMergedSymbol(symbol.parent!) !== typeChecker.resolveExternalModuleSymbol(moduleSymbol)
if (typeChecker.getMergedSymbol(symbol.parent!) !== resolvedModuleSymbol
|| some(symbol.declarations, d => isExportSpecifier(d) && !!d.parent.parent.moduleSpecifier)) {
continue;
}
+1 -1
View File
@@ -180,7 +180,7 @@ namespace ts.DocumentHighlights {
default:
// Don't cross function boundaries.
// TODO: GH#20090
return (isFunctionLike(node) && "quit") as false | "quit";
return isFunctionLike(node) && "quit";
}
});
}
-28
View File
@@ -1399,34 +1399,6 @@ namespace ts.FindAllReferences.Core {
}
}
/**
* Find symbol of the given property-name and add the symbol to the given result array
* @param symbol a symbol to start searching for the given propertyName
* @param propertyName a name of property to search for
* @param result an array of symbol of found property symbols
* @param previousIterationSymbolsCache a cache of symbol from previous iterations of calling this function to prevent infinite revisiting of the same symbol.
* The value of previousIterationSymbol is undefined when the function is first called.
*/
function getPropertySymbolsFromBaseTypes<T>(symbol: Symbol, propertyName: string, checker: TypeChecker, cb: (symbol: Symbol) => T | undefined): T | undefined {
const seen = createMap<true>();
return recur(symbol);
function recur(symbol: Symbol): T | undefined {
// Use `addToSeen` to ensure we don't infinitely recurse in this situation:
// interface C extends C {
// /*findRef*/propName: string;
// }
if (!(symbol.flags & (SymbolFlags.Class | SymbolFlags.Interface)) || !addToSeen(seen, getSymbolId(symbol))) return;
return firstDefined(symbol.declarations, declaration => firstDefined(getAllSuperTypeNodes(declaration), typeReference => {
const type = checker.getTypeAtLocation(typeReference);
const propertySymbol = type && type.symbol && checker.getPropertyOfType(type, propertyName);
// Visit the typeReference as well to see if it directly or indirectly uses that property
return propertySymbol && (firstDefined(checker.getRootSymbols(propertySymbol), cb) || recur(type!.symbol));
}));
}
}
function getRelatedSymbol(search: Search, referenceSymbol: Symbol, referenceLocation: Node, state: State): Symbol | undefined {
const { checker } = state;
return forEachRelatedSymbol(referenceSymbol, referenceLocation, checker,
+11 -16
View File
@@ -243,7 +243,7 @@ namespace ts.JsDoc {
}
const tokenAtPos = getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false);
const tokenStart = tokenAtPos.getStart();
const tokenStart = tokenAtPos.getStart(sourceFile);
if (!tokenAtPos || tokenStart < position) {
return undefined;
}
@@ -253,7 +253,7 @@ namespace ts.JsDoc {
return undefined;
}
const { commentOwner, parameters } = commentOwnerInfo;
if (commentOwner.getStart() < position) {
if (commentOwner.getStart(sourceFile) < position) {
return undefined;
}
@@ -268,19 +268,6 @@ namespace ts.JsDoc {
// replace non-whitespace characters in prefix with spaces.
const indentationStr = sourceFile.text.substr(lineStart, posLineAndChar.character).replace(/\S/i, () => " ");
const isJavaScriptFile = hasJavaScriptFileExtension(sourceFile.fileName);
let docParams = "";
for (let i = 0; i < parameters.length; i++) {
const currentName = parameters[i].name;
const paramName = currentName.kind === SyntaxKind.Identifier ? currentName.escapedText : "param" + i;
if (isJavaScriptFile) {
docParams += `${indentationStr} * @param {any} ${paramName}${newLine}`;
}
else {
docParams += `${indentationStr} * @param ${paramName}${newLine}`;
}
}
// A doc comment consists of the following
// * The opening comment line
@@ -293,13 +280,21 @@ namespace ts.JsDoc {
indentationStr + " * ";
const result =
preamble + newLine +
docParams +
parameterDocComments(parameters, hasJavaScriptFileExtension(sourceFile.fileName), indentationStr, newLine) +
indentationStr + " */" +
(tokenStart === position ? newLine + indentationStr : "");
return { newText: result, caretOffset: preamble.length };
}
function parameterDocComments(parameters: ReadonlyArray<ParameterDeclaration>, isJavaScriptFile: boolean, indentationStr: string, newLine: string): string {
return parameters.map(({ name, dotDotDotToken }, i) => {
const paramName = name.kind === SyntaxKind.Identifier ? name.text : "param" + i;
const type = isJavaScriptFile ? (dotDotDotToken ? "{...any} " : "{any} ") : "";
return `${indentationStr} * @param ${type}${paramName}${newLine}`;
}).join("");
}
interface CommentOwnerInfo {
readonly commentOwner: Node;
readonly parameters?: ReadonlyArray<ParameterDeclaration>;
+3 -11
View File
@@ -1735,17 +1735,9 @@ namespace ts {
synchronizeHostData();
// Exclude default library when renaming as commonly user don't want to change that file.
let sourceFiles: SourceFile[] = [];
if (options && options.isForRename) {
for (const sourceFile of program.getSourceFiles()) {
if (!program.isSourceFileDefaultLibrary(sourceFile)) {
sourceFiles.push(sourceFile);
}
}
}
else {
sourceFiles = program.getSourceFiles().slice();
}
const sourceFiles = options && options.isForRename
? program.getSourceFiles().filter(sourceFile => !program.isSourceFileDefaultLibrary(sourceFile))
: program.getSourceFiles();
return FindAllReferences.findReferencedEntries(program, cancellationToken, sourceFiles, getValidSourceFile(fileName), position, options);
}
+32
View File
@@ -1293,6 +1293,38 @@ namespace ts {
return propSymbol;
}
/**
* Find symbol of the given property-name and add the symbol to the given result array
* @param symbol a symbol to start searching for the given propertyName
* @param propertyName a name of property to search for
* @param result an array of symbol of found property symbols
* @param previousIterationSymbolsCache a cache of symbol from previous iterations of calling this function to prevent infinite revisiting of the same symbol.
* The value of previousIterationSymbol is undefined when the function is first called.
*/
export function getPropertySymbolsFromBaseTypes<T>(symbol: Symbol, propertyName: string, checker: TypeChecker, cb: (symbol: Symbol) => T | undefined): T | undefined {
const seen = createMap<true>();
return recur(symbol);
function recur(symbol: Symbol): T | undefined {
// Use `addToSeen` to ensure we don't infinitely recurse in this situation:
// interface C extends C {
// /*findRef*/propName: string;
// }
if (!(symbol.flags & (SymbolFlags.Class | SymbolFlags.Interface)) || !addToSeen(seen, getSymbolId(symbol))) return;
return firstDefined(symbol.declarations, declaration => firstDefined(getAllSuperTypeNodes(declaration), typeReference => {
const type = checker.getTypeAtLocation(typeReference);
const propertySymbol = type && type.symbol && checker.getPropertyOfType(type, propertyName);
// Visit the typeReference as well to see if it directly or indirectly uses that property
return type && propertySymbol && (firstDefined(checker.getRootSymbols(propertySymbol), cb) || recur(type.symbol));
}));
}
}
export function isMemberSymbolInBaseType(memberSymbol: Symbol, checker: TypeChecker): boolean {
return getPropertySymbolsFromBaseTypes(memberSymbol.parent!, memberSymbol.name, checker, _ => true) || false;
}
export class NodeSet {
private map = createMap<Node>();
@@ -56,8 +56,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
+2 -2
View File
@@ -62,8 +62,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -21,8 +21,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -20,8 +20,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -40,8 +40,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -11,8 +11,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -47,8 +47,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -21,8 +21,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -37,8 +37,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -14,8 +14,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
+2 -2
View File
@@ -14,8 +14,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -1,8 +1,7 @@
tests/cases/conformance/jsx/file.tsx(42,11): error TS2322: Type '{ children: Element[]; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & SingleChildProp'.
Type '{ children: Element[]; a: number; b: string; }' is not assignable to type 'SingleChildProp'.
Types of property 'children' are incompatible.
Type 'Element[]' is not assignable to type 'Element'.
Property 'type' is missing in type 'Element[]'.
tests/cases/conformance/jsx/file.tsx(42,11): error TS2322: Type '{ children: Element[]; a: number; b: string; }' is not assignable to type 'SingleChildProp'.
Types of property 'children' are incompatible.
Type 'Element[]' is not assignable to type 'Element'.
Property 'type' is missing in type 'Element[]'.
==== tests/cases/conformance/jsx/file.tsx (1 errors) ====
@@ -49,8 +48,7 @@ tests/cases/conformance/jsx/file.tsx(42,11): error TS2322: Type '{ children: Ele
// Error
let k5 = <SingleChildComp a={10} b="hi"><></><Button /><AnotherButton /></SingleChildComp>;
~~~~~~~~~~~~~~~
!!! error TS2322: Type '{ children: Element[]; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & SingleChildProp'.
!!! error TS2322: Type '{ children: Element[]; a: number; b: string; }' is not assignable to type 'SingleChildProp'.
!!! error TS2322: Types of property 'children' are incompatible.
!!! error TS2322: Type 'Element[]' is not assignable to type 'Element'.
!!! error TS2322: Property 'type' is missing in type 'Element[]'.
!!! error TS2322: Type '{ children: Element[]; a: number; b: string; }' is not assignable to type 'SingleChildProp'.
!!! error TS2322: Types of property 'children' are incompatible.
!!! error TS2322: Type 'Element[]' is not assignable to type 'Element'.
!!! error TS2322: Property 'type' is missing in type 'Element[]'.
@@ -1,31 +1,26 @@
tests/cases/conformance/jsx/file.tsx(14,10): error TS2322: Type '{ a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'.
Type '{ a: number; b: string; }' is not assignable to type 'Prop'.
Property 'children' is missing in type '{ a: number; b: string; }'.
tests/cases/conformance/jsx/file.tsx(14,10): error TS2322: Type '{ a: number; b: string; }' is not assignable to type 'Prop'.
Property 'children' is missing in type '{ a: number; b: string; }'.
tests/cases/conformance/jsx/file.tsx(17,11): error TS2710: 'children' are specified twice. The attribute named 'children' will be overwritten.
tests/cases/conformance/jsx/file.tsx(31,6): error TS2322: Type '{ children: (Element | ((name: string) => Element))[]; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'.
Type '{ children: (Element | ((name: string) => Element))[]; a: number; b: string; }' is not assignable to type 'Prop'.
Types of property 'children' are incompatible.
Type '(Element | ((name: string) => Element))[]' is not assignable to type 'string | Element'.
Type '(Element | ((name: string) => Element))[]' is not assignable to type 'Element'.
Property 'type' is missing in type '(Element | ((name: string) => Element))[]'.
tests/cases/conformance/jsx/file.tsx(37,6): error TS2322: Type '{ children: (number | Element)[]; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'.
Type '{ children: (number | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'.
Types of property 'children' are incompatible.
Type '(number | Element)[]' is not assignable to type 'string | Element'.
Type '(number | Element)[]' is not assignable to type 'Element'.
Property 'type' is missing in type '(number | Element)[]'.
tests/cases/conformance/jsx/file.tsx(43,6): error TS2322: Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'.
Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'.
Types of property 'children' are incompatible.
Type '(string | Element)[]' is not assignable to type 'string | Element'.
Type '(string | Element)[]' is not assignable to type 'Element'.
Property 'type' is missing in type '(string | Element)[]'.
tests/cases/conformance/jsx/file.tsx(49,6): error TS2322: Type '{ children: Element[]; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'.
Type '{ children: Element[]; a: number; b: string; }' is not assignable to type 'Prop'.
Types of property 'children' are incompatible.
Type 'Element[]' is not assignable to type 'string | Element'.
Type 'Element[]' is not assignable to type 'Element'.
Property 'type' is missing in type 'Element[]'.
tests/cases/conformance/jsx/file.tsx(31,6): error TS2322: Type '{ children: (Element | ((name: string) => Element))[]; a: number; b: string; }' is not assignable to type 'Prop'.
Types of property 'children' are incompatible.
Type '(Element | ((name: string) => Element))[]' is not assignable to type 'string | Element'.
Type '(Element | ((name: string) => Element))[]' is not assignable to type 'Element'.
Property 'type' is missing in type '(Element | ((name: string) => Element))[]'.
tests/cases/conformance/jsx/file.tsx(37,6): error TS2322: Type '{ children: (number | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'.
Types of property 'children' are incompatible.
Type '(number | Element)[]' is not assignable to type 'string | Element'.
Type '(number | Element)[]' is not assignable to type 'Element'.
Property 'type' is missing in type '(number | Element)[]'.
tests/cases/conformance/jsx/file.tsx(43,6): error TS2322: Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'.
Types of property 'children' are incompatible.
Type '(string | Element)[]' is not assignable to type 'string | Element'.
Type '(string | Element)[]' is not assignable to type 'Element'.
Property 'type' is missing in type '(string | Element)[]'.
tests/cases/conformance/jsx/file.tsx(49,6): error TS2322: Type '{ children: Element[]; a: number; b: string; }' is not assignable to type 'Prop'.
Types of property 'children' are incompatible.
Type 'Element[]' is not assignable to type 'string | Element'.
Type 'Element[]' is not assignable to type 'Element'.
Property 'type' is missing in type 'Element[]'.
==== tests/cases/conformance/jsx/file.tsx (6 errors) ====
@@ -44,9 +39,8 @@ tests/cases/conformance/jsx/file.tsx(49,6): error TS2322: Type '{ children: Elem
// Error: missing children
let k = <Comp a={10} b="hi" />;
~~~~
!!! error TS2322: Type '{ a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'.
!!! error TS2322: Type '{ a: number; b: string; }' is not assignable to type 'Prop'.
!!! error TS2322: Property 'children' is missing in type '{ a: number; b: string; }'.
!!! error TS2322: Type '{ a: number; b: string; }' is not assignable to type 'Prop'.
!!! error TS2322: Property 'children' is missing in type '{ a: number; b: string; }'.
let k0 =
<Comp a={10} b="hi" children="Random" >
@@ -67,12 +61,11 @@ tests/cases/conformance/jsx/file.tsx(49,6): error TS2322: Type '{ children: Elem
let k2 =
<Comp a={10} b="hi">
~~~~
!!! error TS2322: Type '{ children: (Element | ((name: string) => Element))[]; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'.
!!! error TS2322: Type '{ children: (Element | ((name: string) => Element))[]; a: number; b: string; }' is not assignable to type 'Prop'.
!!! error TS2322: Types of property 'children' are incompatible.
!!! error TS2322: Type '(Element | ((name: string) => Element))[]' is not assignable to type 'string | Element'.
!!! error TS2322: Type '(Element | ((name: string) => Element))[]' is not assignable to type 'Element'.
!!! error TS2322: Property 'type' is missing in type '(Element | ((name: string) => Element))[]'.
!!! error TS2322: Type '{ children: (Element | ((name: string) => Element))[]; a: number; b: string; }' is not assignable to type 'Prop'.
!!! error TS2322: Types of property 'children' are incompatible.
!!! error TS2322: Type '(Element | ((name: string) => Element))[]' is not assignable to type 'string | Element'.
!!! error TS2322: Type '(Element | ((name: string) => Element))[]' is not assignable to type 'Element'.
!!! error TS2322: Property 'type' is missing in type '(Element | ((name: string) => Element))[]'.
<div> My Div </div>
{(name: string) => <div> My name {name} </div>}
</Comp>;
@@ -80,12 +73,11 @@ tests/cases/conformance/jsx/file.tsx(49,6): error TS2322: Type '{ children: Elem
let k3 =
<Comp a={10} b="hi">
~~~~
!!! error TS2322: Type '{ children: (number | Element)[]; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'.
!!! error TS2322: Type '{ children: (number | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'.
!!! error TS2322: Types of property 'children' are incompatible.
!!! error TS2322: Type '(number | Element)[]' is not assignable to type 'string | Element'.
!!! error TS2322: Type '(number | Element)[]' is not assignable to type 'Element'.
!!! error TS2322: Property 'type' is missing in type '(number | Element)[]'.
!!! error TS2322: Type '{ children: (number | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'.
!!! error TS2322: Types of property 'children' are incompatible.
!!! error TS2322: Type '(number | Element)[]' is not assignable to type 'string | Element'.
!!! error TS2322: Type '(number | Element)[]' is not assignable to type 'Element'.
!!! error TS2322: Property 'type' is missing in type '(number | Element)[]'.
<div> My Div </div>
{1000000}
</Comp>;
@@ -93,12 +85,11 @@ tests/cases/conformance/jsx/file.tsx(49,6): error TS2322: Type '{ children: Elem
let k4 =
<Comp a={10} b="hi" >
~~~~
!!! error TS2322: Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'.
!!! error TS2322: Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'.
!!! error TS2322: Types of property 'children' are incompatible.
!!! error TS2322: Type '(string | Element)[]' is not assignable to type 'string | Element'.
!!! error TS2322: Type '(string | Element)[]' is not assignable to type 'Element'.
!!! error TS2322: Property 'type' is missing in type '(string | Element)[]'.
!!! error TS2322: Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'.
!!! error TS2322: Types of property 'children' are incompatible.
!!! error TS2322: Type '(string | Element)[]' is not assignable to type 'string | Element'.
!!! error TS2322: Type '(string | Element)[]' is not assignable to type 'Element'.
!!! error TS2322: Property 'type' is missing in type '(string | Element)[]'.
<div> My Div </div>
hi hi hi!
</Comp>;
@@ -106,12 +97,11 @@ tests/cases/conformance/jsx/file.tsx(49,6): error TS2322: Type '{ children: Elem
let k5 =
<Comp a={10} b="hi" >
~~~~
!!! error TS2322: Type '{ children: Element[]; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'.
!!! error TS2322: Type '{ children: Element[]; a: number; b: string; }' is not assignable to type 'Prop'.
!!! error TS2322: Types of property 'children' are incompatible.
!!! error TS2322: Type 'Element[]' is not assignable to type 'string | Element'.
!!! error TS2322: Type 'Element[]' is not assignable to type 'Element'.
!!! error TS2322: Property 'type' is missing in type 'Element[]'.
!!! error TS2322: Type '{ children: Element[]; a: number; b: string; }' is not assignable to type 'Prop'.
!!! error TS2322: Types of property 'children' are incompatible.
!!! error TS2322: Type 'Element[]' is not assignable to type 'string | Element'.
!!! error TS2322: Type 'Element[]' is not assignable to type 'Element'.
!!! error TS2322: Property 'type' is missing in type 'Element[]'.
<div> My Div </div>
<div> My Div </div>
</Comp>;
@@ -1,9 +1,8 @@
tests/cases/conformance/jsx/file.tsx(24,28): error TS2551: Property 'NAme' does not exist on type 'IUser'. Did you mean 'Name'?
tests/cases/conformance/jsx/file.tsx(32,10): error TS2322: Type '{ children: ((user: IUser) => Element)[]; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<FetchUser> & IFetchUserProps & { children?: ReactNode; }'.
Type '{ children: ((user: IUser) => Element)[]; }' is not assignable to type 'IFetchUserProps'.
Types of property 'children' are incompatible.
Type '((user: IUser) => Element)[]' is not assignable to type '(user: IUser) => Element'.
Type '((user: IUser) => Element)[]' provides no match for the signature '(user: IUser): Element'.
tests/cases/conformance/jsx/file.tsx(32,10): error TS2322: Type '{ children: ((user: IUser) => Element)[]; }' is not assignable to type 'IFetchUserProps'.
Types of property 'children' are incompatible.
Type '((user: IUser) => Element)[]' is not assignable to type '(user: IUser) => Element'.
Type '((user: IUser) => Element)[]' provides no match for the signature '(user: IUser): Element'.
==== tests/cases/conformance/jsx/file.tsx (2 errors) ====
@@ -42,11 +41,10 @@ tests/cases/conformance/jsx/file.tsx(32,10): error TS2322: Type '{ children: ((u
return (
<FetchUser>
~~~~~~~~~
!!! error TS2322: Type '{ children: ((user: IUser) => Element)[]; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<FetchUser> & IFetchUserProps & { children?: ReactNode; }'.
!!! error TS2322: Type '{ children: ((user: IUser) => Element)[]; }' is not assignable to type 'IFetchUserProps'.
!!! error TS2322: Types of property 'children' are incompatible.
!!! error TS2322: Type '((user: IUser) => Element)[]' is not assignable to type '(user: IUser) => Element'.
!!! error TS2322: Type '((user: IUser) => Element)[]' provides no match for the signature '(user: IUser): Element'.
!!! error TS2322: Type '{ children: ((user: IUser) => Element)[]; }' is not assignable to type 'IFetchUserProps'.
!!! error TS2322: Types of property 'children' are incompatible.
!!! error TS2322: Type '((user: IUser) => Element)[]' is not assignable to type '(user: IUser) => Element'.
!!! error TS2322: Type '((user: IUser) => Element)[]' provides no match for the signature '(user: IUser): Element'.
@@ -1,16 +1,13 @@
tests/cases/conformance/jsx/file.tsx(20,10): error TS2322: Type '{ a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'.
Type '{ a: number; b: string; }' is not assignable to type 'Prop'.
Property 'children' is missing in type '{ a: number; b: string; }'.
tests/cases/conformance/jsx/file.tsx(24,6): error TS2322: Type '{ children: Element; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'.
Type '{ children: Element; a: number; b: string; }' is not assignable to type 'Prop'.
Types of property 'children' are incompatible.
Type 'Element' is not assignable to type 'Button'.
Property 'render' is missing in type 'Element'.
tests/cases/conformance/jsx/file.tsx(28,6): error TS2322: Type '{ children: typeof Button; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'.
Type '{ children: typeof Button; a: number; b: string; }' is not assignable to type 'Prop'.
Types of property 'children' are incompatible.
Type 'typeof Button' is not assignable to type 'Button'.
Property 'render' is missing in type 'typeof Button'.
tests/cases/conformance/jsx/file.tsx(20,10): error TS2322: Type '{ a: number; b: string; }' is not assignable to type 'Prop'.
Property 'children' is missing in type '{ a: number; b: string; }'.
tests/cases/conformance/jsx/file.tsx(24,6): error TS2322: Type '{ children: Element; a: number; b: string; }' is not assignable to type 'Prop'.
Types of property 'children' are incompatible.
Type 'Element' is not assignable to type 'Button'.
Property 'render' is missing in type 'Element'.
tests/cases/conformance/jsx/file.tsx(28,6): error TS2322: Type '{ children: typeof Button; a: number; b: string; }' is not assignable to type 'Prop'.
Types of property 'children' are incompatible.
Type 'typeof Button' is not assignable to type 'Button'.
Property 'render' is missing in type 'typeof Button'.
==== tests/cases/conformance/jsx/file.tsx (3 errors) ====
@@ -35,28 +32,25 @@ tests/cases/conformance/jsx/file.tsx(28,6): error TS2322: Type '{ children: type
// Error: no children specified
let k = <Comp a={10} b="hi" />;
~~~~
!!! error TS2322: Type '{ a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'.
!!! error TS2322: Type '{ a: number; b: string; }' is not assignable to type 'Prop'.
!!! error TS2322: Property 'children' is missing in type '{ a: number; b: string; }'.
!!! error TS2322: Type '{ a: number; b: string; }' is not assignable to type 'Prop'.
!!! error TS2322: Property 'children' is missing in type '{ a: number; b: string; }'.
// Error: JSX.element is not the same as JSX.ElementClass
let k1 =
<Comp a={10} b="hi">
~~~~
!!! error TS2322: Type '{ children: Element; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'.
!!! error TS2322: Type '{ children: Element; a: number; b: string; }' is not assignable to type 'Prop'.
!!! error TS2322: Types of property 'children' are incompatible.
!!! error TS2322: Type 'Element' is not assignable to type 'Button'.
!!! error TS2322: Property 'render' is missing in type 'Element'.
!!! error TS2322: Type '{ children: Element; a: number; b: string; }' is not assignable to type 'Prop'.
!!! error TS2322: Types of property 'children' are incompatible.
!!! error TS2322: Type 'Element' is not assignable to type 'Button'.
!!! error TS2322: Property 'render' is missing in type 'Element'.
<Button />
</Comp>;
let k2 =
<Comp a={10} b="hi">
~~~~
!!! error TS2322: Type '{ children: typeof Button; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'.
!!! error TS2322: Type '{ children: typeof Button; a: number; b: string; }' is not assignable to type 'Prop'.
!!! error TS2322: Types of property 'children' are incompatible.
!!! error TS2322: Type 'typeof Button' is not assignable to type 'Button'.
!!! error TS2322: Property 'render' is missing in type 'typeof Button'.
!!! error TS2322: Type '{ children: typeof Button; a: number; b: string; }' is not assignable to type 'Prop'.
!!! error TS2322: Types of property 'children' are incompatible.
!!! error TS2322: Type 'typeof Button' is not assignable to type 'Button'.
!!! error TS2322: Property 'render' is missing in type 'typeof Button'.
{Button}
</Comp>;
@@ -1,20 +1,17 @@
tests/cases/conformance/jsx/file.tsx(24,11): error TS2322: Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'.
Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'.
Types of property 'children' are incompatible.
Type '(string | Element)[]' is not assignable to type 'Element | Element[]'.
Type '(string | Element)[]' is not assignable to type 'Element[]'.
Type 'string | Element' is not assignable to type 'Element'.
Type 'string' is not assignable to type 'Element'.
tests/cases/conformance/jsx/file.tsx(25,11): error TS2322: Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'.
Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'.
Types of property 'children' are incompatible.
Type '(string | Element)[]' is not assignable to type 'Element | Element[]'.
Type '(string | Element)[]' is not assignable to type 'Element[]'.
tests/cases/conformance/jsx/file.tsx(27,11): error TS2322: Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'.
Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'.
Types of property 'children' are incompatible.
Type '(string | Element)[]' is not assignable to type 'Element | Element[]'.
Type '(string | Element)[]' is not assignable to type 'Element[]'.
tests/cases/conformance/jsx/file.tsx(24,11): error TS2322: Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'.
Types of property 'children' are incompatible.
Type '(string | Element)[]' is not assignable to type 'Element | Element[]'.
Type '(string | Element)[]' is not assignable to type 'Element[]'.
Type 'string | Element' is not assignable to type 'Element'.
Type 'string' is not assignable to type 'Element'.
tests/cases/conformance/jsx/file.tsx(25,11): error TS2322: Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'.
Types of property 'children' are incompatible.
Type '(string | Element)[]' is not assignable to type 'Element | Element[]'.
Type '(string | Element)[]' is not assignable to type 'Element[]'.
tests/cases/conformance/jsx/file.tsx(27,11): error TS2322: Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'.
Types of property 'children' are incompatible.
Type '(string | Element)[]' is not assignable to type 'Element | Element[]'.
Type '(string | Element)[]' is not assignable to type 'Element[]'.
==== tests/cases/conformance/jsx/file.tsx (3 errors) ====
@@ -43,26 +40,23 @@ tests/cases/conformance/jsx/file.tsx(27,11): error TS2322: Type '{ children: (st
// Error: whitespaces matters
let k1 = <Comp a={10} b="hi"><Button /> <AnotherButton /></Comp>;
~~~~
!!! error TS2322: Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'.
!!! error TS2322: Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'.
!!! error TS2322: Types of property 'children' are incompatible.
!!! error TS2322: Type '(string | Element)[]' is not assignable to type 'Element | Element[]'.
!!! error TS2322: Type '(string | Element)[]' is not assignable to type 'Element[]'.
!!! error TS2322: Type 'string | Element' is not assignable to type 'Element'.
!!! error TS2322: Type 'string' is not assignable to type 'Element'.
!!! error TS2322: Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'.
!!! error TS2322: Types of property 'children' are incompatible.
!!! error TS2322: Type '(string | Element)[]' is not assignable to type 'Element | Element[]'.
!!! error TS2322: Type '(string | Element)[]' is not assignable to type 'Element[]'.
!!! error TS2322: Type 'string | Element' is not assignable to type 'Element'.
!!! error TS2322: Type 'string' is not assignable to type 'Element'.
let k2 = <Comp a={10} b="hi"><Button />
~~~~
!!! error TS2322: Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'.
!!! error TS2322: Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'.
!!! error TS2322: Types of property 'children' are incompatible.
!!! error TS2322: Type '(string | Element)[]' is not assignable to type 'Element | Element[]'.
!!! error TS2322: Type '(string | Element)[]' is not assignable to type 'Element[]'.
!!! error TS2322: Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'.
!!! error TS2322: Types of property 'children' are incompatible.
!!! error TS2322: Type '(string | Element)[]' is not assignable to type 'Element | Element[]'.
!!! error TS2322: Type '(string | Element)[]' is not assignable to type 'Element[]'.
<AnotherButton /> </Comp>;
let k3 = <Comp a={10} b="hi"> <Button />
~~~~
!!! error TS2322: Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'.
!!! error TS2322: Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'.
!!! error TS2322: Types of property 'children' are incompatible.
!!! error TS2322: Type '(string | Element)[]' is not assignable to type 'Element | Element[]'.
!!! error TS2322: Type '(string | Element)[]' is not assignable to type 'Element[]'.
!!! error TS2322: Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'.
!!! error TS2322: Types of property 'children' are incompatible.
!!! error TS2322: Type '(string | Element)[]' is not assignable to type 'Element | Element[]'.
!!! error TS2322: Type '(string | Element)[]' is not assignable to type 'Element[]'.
<AnotherButton /></Comp>;
@@ -1,9 +1,7 @@
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(27,13): error TS2322: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'LinkProps'.
Property 'goTo' is missing in type '{ extra: true; onClick: (k: "left" | "right") => void; }'.
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(28,13): error TS2322: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'LinkProps'.
Property 'goTo' is missing in type '{ onClick: (k: "left" | "right") => void; extra: true; }'.
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(27,13): error TS2322: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'LinkProps'.
Property 'goTo' is missing in type '{ extra: true; onClick: (k: "left" | "right") => void; }'.
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(28,13): error TS2322: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'LinkProps'.
Property 'goTo' is missing in type '{ onClick: (k: "left" | "right") => void; extra: true; }'.
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(29,43): error TS2339: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(30,36): error TS2339: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(33,65): error TS2339: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'.
@@ -39,14 +37,12 @@ tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(36,44): err
const b0 = <MainButton {...{onClick: (k) => {console.log(k)}}} extra />; // k has type "left" | "right"
~~~~~~~~~~
!!! error TS2322: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
!!! error TS2322: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'LinkProps'.
!!! error TS2322: Property 'goTo' is missing in type '{ extra: true; onClick: (k: "left" | "right") => void; }'.
!!! error TS2322: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'LinkProps'.
!!! error TS2322: Property 'goTo' is missing in type '{ extra: true; onClick: (k: "left" | "right") => void; }'.
const b2 = <MainButton onClick={(k)=>{console.log(k)}} extra />; // k has type "left" | "right"
~~~~~~~~~~
!!! error TS2322: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
!!! error TS2322: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'LinkProps'.
!!! error TS2322: Property 'goTo' is missing in type '{ onClick: (k: "left" | "right") => void; extra: true; }'.
!!! error TS2322: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'LinkProps'.
!!! error TS2322: Property 'goTo' is missing in type '{ onClick: (k: "left" | "right") => void; extra: true; }'.
const b3 = <MainButton {...{goTo:"home"}} extra />; // goTo has type"home" | "contact"
~~~~~
!!! error TS2339: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
@@ -41,8 +41,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -22,8 +22,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -68,8 +68,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -120,8 +120,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -179,8 +179,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -238,8 +238,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -319,8 +319,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -408,8 +408,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -466,8 +466,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -518,8 +518,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -583,8 +583,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -37,8 +37,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -84,8 +84,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -138,8 +138,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -192,8 +192,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -268,8 +268,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -352,8 +352,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -405,8 +405,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -37,8 +37,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -84,8 +84,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -138,8 +138,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -192,8 +192,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -268,8 +268,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -352,8 +352,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -405,8 +405,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -51,8 +51,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -100,8 +100,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -156,8 +156,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -212,8 +212,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -290,8 +290,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -376,8 +376,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -431,8 +431,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -63,7 +63,7 @@ function f1() {
let y;
try {
for (var y_1 = __asyncValues(y), y_1_1; y_1_1 = yield y_1.next(), !y_1_1.done;) {
const x = yield y_1_1.value;
const x = y_1_1.value;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
@@ -97,7 +97,7 @@ function f2() {
let x, y;
try {
for (var y_1 = __asyncValues(y), y_1_1; y_1_1 = yield y_1.next(), !y_1_1.done;) {
x = yield y_1_1.value;
x = y_1_1.value;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
@@ -135,7 +135,7 @@ function f3() {
let y;
try {
for (var y_1 = __asyncValues(y), y_1_1; y_1_1 = yield __await(y_1.next()), !y_1_1.done;) {
const x = yield yield __await(__await(y_1_1.value));
const x = y_1_1.value;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
@@ -173,7 +173,7 @@ function f4() {
let x, y;
try {
for (var y_1 = __asyncValues(y), y_1_1; y_1_1 = yield __await(y_1.next()), !y_1_1.done;) {
x = yield yield __await(__await(y_1_1.value));
x = y_1_1.value;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
@@ -208,7 +208,7 @@ function f5() {
let y;
try {
outer: for (var y_1 = __asyncValues(y), y_1_1; y_1_1 = yield y_1.next(), !y_1_1.done;) {
const x = yield y_1_1.value;
const x = y_1_1.value;
continue outer;
}
}
@@ -248,7 +248,7 @@ function f6() {
let y;
try {
outer: for (var y_1 = __asyncValues(y), y_1_1; y_1_1 = yield __await(y_1.next()), !y_1_1.done;) {
const x = yield yield __await(__await(y_1_1.value));
const x = y_1_1.value;
continue outer;
}
}
@@ -54,7 +54,7 @@ async function f1() {
let y;
try {
for (var y_1 = __asyncValues(y), y_1_1; y_1_1 = await y_1.next(), !y_1_1.done;) {
const x = await y_1_1.value;
const x = y_1_1.value;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
@@ -78,7 +78,7 @@ async function f2() {
let x, y;
try {
for (var y_1 = __asyncValues(y), y_1_1; y_1_1 = await y_1.next(), !y_1_1.done;) {
x = await y_1_1.value;
x = y_1_1.value;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
@@ -115,7 +115,7 @@ function f3() {
let y;
try {
for (var y_1 = __asyncValues(y), y_1_1; y_1_1 = yield __await(y_1.next()), !y_1_1.done;) {
const x = yield yield __await(__await(y_1_1.value));
const x = y_1_1.value;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
@@ -153,7 +153,7 @@ function f4() {
let x, y;
try {
for (var y_1 = __asyncValues(y), y_1_1; y_1_1 = yield __await(y_1.next()), !y_1_1.done;) {
x = yield yield __await(__await(y_1_1.value));
x = y_1_1.value;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
@@ -179,7 +179,7 @@ async function f5() {
let y;
try {
outer: for (var y_1 = __asyncValues(y), y_1_1; y_1_1 = await y_1.next(), !y_1_1.done;) {
const x = await y_1_1.value;
const x = y_1_1.value;
continue outer;
}
}
@@ -218,7 +218,7 @@ function f6() {
let y;
try {
outer: for (var y_1 = __asyncValues(y), y_1_1; y_1_1 = yield __await(y_1.next()), !y_1_1.done;) {
const x = yield yield __await(__await(y_1_1.value));
const x = y_1_1.value;
continue outer;
}
}
+114 -129
View File
@@ -57,8 +57,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -90,35 +90,33 @@ function f1() {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_b.trys.push([0, 6, 7, 12]);
_b.trys.push([0, 5, 6, 11]);
y_1 = __asyncValues(y);
_b.label = 1;
case 1: return [4 /*yield*/, y_1.next()];
case 2:
if (!(y_1_1 = _b.sent(), !y_1_1.done)) return [3 /*break*/, 5];
return [4 /*yield*/, y_1_1.value];
case 3:
x = _b.sent();
_b.label = 4;
case 4: return [3 /*break*/, 1];
case 5: return [3 /*break*/, 12];
case 6:
if (!(y_1_1 = _b.sent(), !y_1_1.done)) return [3 /*break*/, 4];
x = y_1_1.value;
_b.label = 3;
case 3: return [3 /*break*/, 1];
case 4: return [3 /*break*/, 11];
case 5:
e_1_1 = _b.sent();
e_1 = { error: e_1_1 };
return [3 /*break*/, 12];
case 7:
_b.trys.push([7, , 10, 11]);
if (!(y_1_1 && !y_1_1.done && (_a = y_1.return))) return [3 /*break*/, 9];
return [3 /*break*/, 11];
case 6:
_b.trys.push([6, , 9, 10]);
if (!(y_1_1 && !y_1_1.done && (_a = y_1.return))) return [3 /*break*/, 8];
return [4 /*yield*/, _a.call(y_1)];
case 8:
case 7:
_b.sent();
_b.label = 9;
case 9: return [3 /*break*/, 11];
case 10:
_b.label = 8;
case 8: return [3 /*break*/, 10];
case 9:
if (e_1) throw e_1.error;
return [7 /*endfinally*/];
case 11: return [7 /*endfinally*/];
case 12: return [2 /*return*/];
case 10: return [7 /*endfinally*/];
case 11: return [2 /*return*/];
}
});
});
@@ -139,8 +137,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -172,35 +170,33 @@ function f2() {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_b.trys.push([0, 6, 7, 12]);
_b.trys.push([0, 5, 6, 11]);
y_1 = __asyncValues(y);
_b.label = 1;
case 1: return [4 /*yield*/, y_1.next()];
case 2:
if (!(y_1_1 = _b.sent(), !y_1_1.done)) return [3 /*break*/, 5];
return [4 /*yield*/, y_1_1.value];
case 3:
x = _b.sent();
_b.label = 4;
case 4: return [3 /*break*/, 1];
case 5: return [3 /*break*/, 12];
case 6:
if (!(y_1_1 = _b.sent(), !y_1_1.done)) return [3 /*break*/, 4];
x = y_1_1.value;
_b.label = 3;
case 3: return [3 /*break*/, 1];
case 4: return [3 /*break*/, 11];
case 5:
e_1_1 = _b.sent();
e_1 = { error: e_1_1 };
return [3 /*break*/, 12];
case 7:
_b.trys.push([7, , 10, 11]);
if (!(y_1_1 && !y_1_1.done && (_a = y_1.return))) return [3 /*break*/, 9];
return [3 /*break*/, 11];
case 6:
_b.trys.push([6, , 9, 10]);
if (!(y_1_1 && !y_1_1.done && (_a = y_1.return))) return [3 /*break*/, 8];
return [4 /*yield*/, _a.call(y_1)];
case 8:
case 7:
_b.sent();
_b.label = 9;
case 9: return [3 /*break*/, 11];
case 10:
_b.label = 8;
case 8: return [3 /*break*/, 10];
case 9:
if (e_1) throw e_1.error;
return [7 /*endfinally*/];
case 11: return [7 /*endfinally*/];
case 12: return [2 /*return*/];
case 10: return [7 /*endfinally*/];
case 11: return [2 /*return*/];
}
});
});
@@ -213,8 +209,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -258,36 +254,33 @@ function f3() {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_b.trys.push([0, 7, 8, 13]);
_b.trys.push([0, 5, 6, 11]);
y_1 = __asyncValues(y);
_b.label = 1;
case 1: return [4 /*yield*/, __await(y_1.next())];
case 2:
if (!(y_1_1 = _b.sent(), !y_1_1.done)) return [3 /*break*/, 6];
return [4 /*yield*/, __await(__await(y_1_1.value))];
case 3: return [4 /*yield*/, _b.sent()];
case 4:
x = _b.sent();
_b.label = 5;
case 5: return [3 /*break*/, 1];
case 6: return [3 /*break*/, 13];
case 7:
if (!(y_1_1 = _b.sent(), !y_1_1.done)) return [3 /*break*/, 4];
x = y_1_1.value;
_b.label = 3;
case 3: return [3 /*break*/, 1];
case 4: return [3 /*break*/, 11];
case 5:
e_1_1 = _b.sent();
e_1 = { error: e_1_1 };
return [3 /*break*/, 13];
case 8:
_b.trys.push([8, , 11, 12]);
if (!(y_1_1 && !y_1_1.done && (_a = y_1.return))) return [3 /*break*/, 10];
return [3 /*break*/, 11];
case 6:
_b.trys.push([6, , 9, 10]);
if (!(y_1_1 && !y_1_1.done && (_a = y_1.return))) return [3 /*break*/, 8];
return [4 /*yield*/, __await(_a.call(y_1))];
case 9:
case 7:
_b.sent();
_b.label = 10;
case 10: return [3 /*break*/, 12];
case 11:
_b.label = 8;
case 8: return [3 /*break*/, 10];
case 9:
if (e_1) throw e_1.error;
return [7 /*endfinally*/];
case 12: return [7 /*endfinally*/];
case 13: return [2 /*return*/];
case 10: return [7 /*endfinally*/];
case 11: return [2 /*return*/];
}
});
});
@@ -300,8 +293,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -345,36 +338,33 @@ function f4() {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_b.trys.push([0, 7, 8, 13]);
_b.trys.push([0, 5, 6, 11]);
y_1 = __asyncValues(y);
_b.label = 1;
case 1: return [4 /*yield*/, __await(y_1.next())];
case 2:
if (!(y_1_1 = _b.sent(), !y_1_1.done)) return [3 /*break*/, 6];
return [4 /*yield*/, __await(__await(y_1_1.value))];
case 3: return [4 /*yield*/, _b.sent()];
case 4:
x = _b.sent();
_b.label = 5;
case 5: return [3 /*break*/, 1];
case 6: return [3 /*break*/, 13];
case 7:
if (!(y_1_1 = _b.sent(), !y_1_1.done)) return [3 /*break*/, 4];
x = y_1_1.value;
_b.label = 3;
case 3: return [3 /*break*/, 1];
case 4: return [3 /*break*/, 11];
case 5:
e_1_1 = _b.sent();
e_1 = { error: e_1_1 };
return [3 /*break*/, 13];
case 8:
_b.trys.push([8, , 11, 12]);
if (!(y_1_1 && !y_1_1.done && (_a = y_1.return))) return [3 /*break*/, 10];
return [3 /*break*/, 11];
case 6:
_b.trys.push([6, , 9, 10]);
if (!(y_1_1 && !y_1_1.done && (_a = y_1.return))) return [3 /*break*/, 8];
return [4 /*yield*/, __await(_a.call(y_1))];
case 9:
case 7:
_b.sent();
_b.label = 10;
case 10: return [3 /*break*/, 12];
case 11:
_b.label = 8;
case 8: return [3 /*break*/, 10];
case 9:
if (e_1) throw e_1.error;
return [7 /*endfinally*/];
case 12: return [7 /*endfinally*/];
case 13: return [2 /*return*/];
case 10: return [7 /*endfinally*/];
case 11: return [2 /*return*/];
}
});
});
@@ -395,8 +385,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -429,35 +419,33 @@ function f5() {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_b.trys.push([0, 6, 7, 12]);
_b.trys.push([0, 5, 6, 11]);
y_1 = __asyncValues(y);
_b.label = 1;
case 1: return [4 /*yield*/, y_1.next()];
case 2:
if (!(y_1_1 = _b.sent(), !y_1_1.done)) return [3 /*break*/, 5];
return [4 /*yield*/, y_1_1.value];
case 3:
x = _b.sent();
return [3 /*break*/, 4];
case 4: return [3 /*break*/, 1];
case 5: return [3 /*break*/, 12];
case 6:
if (!(y_1_1 = _b.sent(), !y_1_1.done)) return [3 /*break*/, 4];
x = y_1_1.value;
return [3 /*break*/, 3];
case 3: return [3 /*break*/, 1];
case 4: return [3 /*break*/, 11];
case 5:
e_1_1 = _b.sent();
e_1 = { error: e_1_1 };
return [3 /*break*/, 12];
case 7:
_b.trys.push([7, , 10, 11]);
if (!(y_1_1 && !y_1_1.done && (_a = y_1.return))) return [3 /*break*/, 9];
return [3 /*break*/, 11];
case 6:
_b.trys.push([6, , 9, 10]);
if (!(y_1_1 && !y_1_1.done && (_a = y_1.return))) return [3 /*break*/, 8];
return [4 /*yield*/, _a.call(y_1)];
case 8:
case 7:
_b.sent();
_b.label = 9;
case 9: return [3 /*break*/, 11];
case 10:
_b.label = 8;
case 8: return [3 /*break*/, 10];
case 9:
if (e_1) throw e_1.error;
return [7 /*endfinally*/];
case 11: return [7 /*endfinally*/];
case 12: return [2 /*return*/];
case 10: return [7 /*endfinally*/];
case 11: return [2 /*return*/];
}
});
});
@@ -470,8 +458,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -516,36 +504,33 @@ function f6() {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_b.trys.push([0, 7, 8, 13]);
_b.trys.push([0, 5, 6, 11]);
y_1 = __asyncValues(y);
_b.label = 1;
case 1: return [4 /*yield*/, __await(y_1.next())];
case 2:
if (!(y_1_1 = _b.sent(), !y_1_1.done)) return [3 /*break*/, 6];
return [4 /*yield*/, __await(__await(y_1_1.value))];
case 3: return [4 /*yield*/, _b.sent()];
case 4:
x = _b.sent();
return [3 /*break*/, 5];
case 5: return [3 /*break*/, 1];
case 6: return [3 /*break*/, 13];
case 7:
if (!(y_1_1 = _b.sent(), !y_1_1.done)) return [3 /*break*/, 4];
x = y_1_1.value;
return [3 /*break*/, 3];
case 3: return [3 /*break*/, 1];
case 4: return [3 /*break*/, 11];
case 5:
e_1_1 = _b.sent();
e_1 = { error: e_1_1 };
return [3 /*break*/, 13];
case 8:
_b.trys.push([8, , 11, 12]);
if (!(y_1_1 && !y_1_1.done && (_a = y_1.return))) return [3 /*break*/, 10];
return [3 /*break*/, 11];
case 6:
_b.trys.push([6, , 9, 10]);
if (!(y_1_1 && !y_1_1.done && (_a = y_1.return))) return [3 /*break*/, 8];
return [4 /*yield*/, __await(_a.call(y_1))];
case 9:
case 7:
_b.sent();
_b.label = 10;
case 10: return [3 /*break*/, 12];
case 11:
_b.label = 8;
case 8: return [3 /*break*/, 10];
case 9:
if (e_1) throw e_1.error;
return [7 /*endfinally*/];
case 12: return [7 /*endfinally*/];
case 13: return [2 /*return*/];
case 10: return [7 /*endfinally*/];
case 11: return [2 /*return*/];
}
});
});
@@ -24,8 +24,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -45,8 +45,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -24,8 +24,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -23,8 +23,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -44,8 +44,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -45,8 +45,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -46,8 +46,8 @@ System.register([], function (exports_1, context_1) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -44,8 +44,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -44,8 +44,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -45,8 +45,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -46,8 +46,8 @@ System.register([], function (exports_1, context_1) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -44,8 +44,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -30,8 +30,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -28,8 +28,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -26,8 +26,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -26,8 +26,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -36,8 +36,8 @@ System.register([], function (exports_1, context_1) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -38,8 +38,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -59,8 +59,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
+2 -2
View File
@@ -55,8 +55,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -24,8 +24,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -0,0 +1,14 @@
=== tests/cases/conformance/salsa/bug24062.js ===
// #24062
class C {
>C : Symbol(C, Decl(bug24062.js, 0, 0))
}
module.exports = {
>module : Symbol(export=, Decl(bug24062.js, 2, 1))
>exports : Symbol(export=, Decl(bug24062.js, 2, 1))
C
>C : Symbol(C, Decl(bug24062.js, 3, 18))
};
@@ -0,0 +1,17 @@
=== tests/cases/conformance/salsa/bug24062.js ===
// #24062
class C {
>C : C
}
module.exports = {
>module.exports = { C} : { [x: string]: any; C: typeof C; }
>module.exports : any
>module : any
>exports : any
>{ C} : { [x: string]: any; C: typeof C; }
C
>C : typeof C
};
@@ -21,8 +21,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -20,8 +20,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -13,8 +13,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -39,8 +39,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
@@ -0,0 +1,38 @@
tests/cases/conformance/jsx/tsxIntrinsicAttributeErrors.tsx(29,2): error TS2322: Type '{ x: number; }' is not assignable to type 'IntrinsicAttributes'.
Property 'key' is missing in type '{ x: number; }'.
==== tests/cases/conformance/jsx/tsxIntrinsicAttributeErrors.tsx (1 errors) ====
declare namespace JSX {
interface Element { }
interface ElementClass {
render: any;
}
interface IntrinsicAttributes {
key: string | number
}
interface IntrinsicClassAttributes<T> {
ref: T
}
interface IntrinsicElements {
div: {
text?: string;
width?: number;
}
span: any;
}
}
interface I {
new(n: string): {
x: number
render(): void
}
}
var E: I;
<E x={10} />
~
!!! error TS2322: Type '{ x: number; }' is not assignable to type 'IntrinsicAttributes'.
!!! error TS2322: Property 'key' is missing in type '{ x: number; }'.
@@ -0,0 +1,35 @@
//// [tsxIntrinsicAttributeErrors.tsx]
declare namespace JSX {
interface Element { }
interface ElementClass {
render: any;
}
interface IntrinsicAttributes {
key: string | number
}
interface IntrinsicClassAttributes<T> {
ref: T
}
interface IntrinsicElements {
div: {
text?: string;
width?: number;
}
span: any;
}
}
interface I {
new(n: string): {
x: number
render(): void
}
}
var E: I;
<E x={10} />
//// [tsxIntrinsicAttributeErrors.jsx]
var E;
<E x={10}/>;
@@ -0,0 +1,66 @@
=== tests/cases/conformance/jsx/tsxIntrinsicAttributeErrors.tsx ===
declare namespace JSX {
>JSX : Symbol(JSX, Decl(tsxIntrinsicAttributeErrors.tsx, 0, 0))
interface Element { }
>Element : Symbol(Element, Decl(tsxIntrinsicAttributeErrors.tsx, 0, 23))
interface ElementClass {
>ElementClass : Symbol(ElementClass, Decl(tsxIntrinsicAttributeErrors.tsx, 1, 25))
render: any;
>render : Symbol(ElementClass.render, Decl(tsxIntrinsicAttributeErrors.tsx, 2, 28))
}
interface IntrinsicAttributes {
>IntrinsicAttributes : Symbol(IntrinsicAttributes, Decl(tsxIntrinsicAttributeErrors.tsx, 4, 5))
key: string | number
>key : Symbol(IntrinsicAttributes.key, Decl(tsxIntrinsicAttributeErrors.tsx, 5, 35))
}
interface IntrinsicClassAttributes<T> {
>IntrinsicClassAttributes : Symbol(IntrinsicClassAttributes, Decl(tsxIntrinsicAttributeErrors.tsx, 7, 5))
>T : Symbol(T, Decl(tsxIntrinsicAttributeErrors.tsx, 8, 39))
ref: T
>ref : Symbol(IntrinsicClassAttributes.ref, Decl(tsxIntrinsicAttributeErrors.tsx, 8, 43))
>T : Symbol(T, Decl(tsxIntrinsicAttributeErrors.tsx, 8, 39))
}
interface IntrinsicElements {
>IntrinsicElements : Symbol(IntrinsicElements, Decl(tsxIntrinsicAttributeErrors.tsx, 10, 5))
div: {
>div : Symbol(IntrinsicElements.div, Decl(tsxIntrinsicAttributeErrors.tsx, 11, 33))
text?: string;
>text : Symbol(text, Decl(tsxIntrinsicAttributeErrors.tsx, 12, 14))
width?: number;
>width : Symbol(width, Decl(tsxIntrinsicAttributeErrors.tsx, 13, 26))
}
span: any;
>span : Symbol(IntrinsicElements.span, Decl(tsxIntrinsicAttributeErrors.tsx, 15, 9))
}
}
interface I {
>I : Symbol(I, Decl(tsxIntrinsicAttributeErrors.tsx, 19, 1))
new(n: string): {
>n : Symbol(n, Decl(tsxIntrinsicAttributeErrors.tsx, 22, 8))
x: number
>x : Symbol(x, Decl(tsxIntrinsicAttributeErrors.tsx, 22, 21))
render(): void
>render : Symbol(render, Decl(tsxIntrinsicAttributeErrors.tsx, 23, 17))
}
}
var E: I;
>E : Symbol(E, Decl(tsxIntrinsicAttributeErrors.tsx, 27, 3))
>I : Symbol(I, Decl(tsxIntrinsicAttributeErrors.tsx, 19, 1))
<E x={10} />
>E : Symbol(E, Decl(tsxIntrinsicAttributeErrors.tsx, 27, 3))
>x : Symbol(x, Decl(tsxIntrinsicAttributeErrors.tsx, 28, 2))
@@ -0,0 +1,68 @@
=== tests/cases/conformance/jsx/tsxIntrinsicAttributeErrors.tsx ===
declare namespace JSX {
>JSX : any
interface Element { }
>Element : Element
interface ElementClass {
>ElementClass : ElementClass
render: any;
>render : any
}
interface IntrinsicAttributes {
>IntrinsicAttributes : IntrinsicAttributes
key: string | number
>key : string | number
}
interface IntrinsicClassAttributes<T> {
>IntrinsicClassAttributes : IntrinsicClassAttributes<T>
>T : T
ref: T
>ref : T
>T : T
}
interface IntrinsicElements {
>IntrinsicElements : IntrinsicElements
div: {
>div : { text?: string; width?: number; }
text?: string;
>text : string
width?: number;
>width : number
}
span: any;
>span : any
}
}
interface I {
>I : I
new(n: string): {
>n : string
x: number
>x : number
render(): void
>render : () => void
}
}
var E: I;
>E : I
>I : I
<E x={10} />
><E x={10} /> : JSX.Element
>E : I
>x : number
>10 : 10
@@ -1,6 +1,5 @@
tests/cases/conformance/jsx/file.tsx(13,11): error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<MyComp<Prop>> & Prop & { children?: ReactNode; }'.
Type '{}' is not assignable to type 'Prop'.
Property 'a' is missing in type '{}'.
tests/cases/conformance/jsx/file.tsx(13,11): error TS2322: Type '{}' is not assignable to type 'Prop'.
Property 'a' is missing in type '{}'.
tests/cases/conformance/jsx/file.tsx(19,18): error TS2326: Types of property 'a' are incompatible.
Type 'string' is not assignable to type 'number'.
@@ -20,9 +19,8 @@ tests/cases/conformance/jsx/file.tsx(19,18): error TS2326: Types of property 'a'
// Error
let x1 = <MyComp />
~~~~~~
!!! error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<MyComp<Prop>> & Prop & { children?: ReactNode; }'.
!!! error TS2322: Type '{}' is not assignable to type 'Prop'.
!!! error TS2322: Property 'a' is missing in type '{}'.
!!! error TS2322: Type '{}' is not assignable to type 'Prop'.
!!! error TS2322: Property 'a' is missing in type '{}'.
// OK
let x = <MyComp a={10} b="hi" />
@@ -2,10 +2,9 @@ tests/cases/conformance/jsx/file.tsx(27,33): error TS2326: Types of property 'y'
Type 'true' is not assignable to type 'false'.
tests/cases/conformance/jsx/file.tsx(28,50): error TS2326: Types of property 'x' are incompatible.
Type '3' is not assignable to type '2'.
tests/cases/conformance/jsx/file.tsx(30,11): error TS2322: Type '{ y: true; x: 2; overwrite: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<OverWriteAttr> & Prop & { children?: ReactNode; }'.
Type '{ y: true; x: 2; overwrite: string; }' is not assignable to type 'Prop'.
Types of property 'y' are incompatible.
Type 'true' is not assignable to type 'false'.
tests/cases/conformance/jsx/file.tsx(30,11): error TS2322: Type '{ y: true; x: 2; overwrite: string; }' is not assignable to type 'Prop'.
Types of property 'y' are incompatible.
Type 'true' is not assignable to type 'false'.
==== tests/cases/conformance/jsx/file.tsx (3 errors) ====
@@ -46,9 +45,8 @@ tests/cases/conformance/jsx/file.tsx(30,11): error TS2322: Type '{ y: true; x: 2
let x2 = <OverWriteAttr {...anyobj} x={3} />
let x3 = <OverWriteAttr overwrite="hi" {...obj1} {...{y: true}} />
~~~~~~~~~~~~~
!!! error TS2322: Type '{ y: true; x: 2; overwrite: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<OverWriteAttr> & Prop & { children?: ReactNode; }'.
!!! error TS2322: Type '{ y: true; x: 2; overwrite: string; }' is not assignable to type 'Prop'.
!!! error TS2322: Types of property 'y' are incompatible.
!!! error TS2322: Type 'true' is not assignable to type 'false'.
!!! error TS2322: Type '{ y: true; x: 2; overwrite: string; }' is not assignable to type 'Prop'.
!!! error TS2322: Types of property 'y' are incompatible.
!!! error TS2322: Type 'true' is not assignable to type 'false'.
@@ -1,6 +1,5 @@
tests/cases/conformance/jsx/file.tsx(11,10): error TS2322: Type '{ property1: string; property2: number; }' is not assignable to type 'IntrinsicAttributes & AnotherComponentProps'.
Type '{ property1: string; property2: number; }' is not assignable to type 'AnotherComponentProps'.
Property 'AnotherProperty1' is missing in type '{ property1: string; property2: number; }'.
tests/cases/conformance/jsx/file.tsx(11,10): error TS2322: Type '{ property1: string; property2: number; }' is not assignable to type 'AnotherComponentProps'.
Property 'AnotherProperty1' is missing in type '{ property1: string; property2: number; }'.
==== tests/cases/conformance/jsx/file.tsx (1 errors) ====
@@ -16,9 +15,8 @@ tests/cases/conformance/jsx/file.tsx(11,10): error TS2322: Type '{ property1: st
// Error: missing property
<AnotherComponent {...props} />
~~~~~~~~~~~~~~~~
!!! error TS2322: Type '{ property1: string; property2: number; }' is not assignable to type 'IntrinsicAttributes & AnotherComponentProps'.
!!! error TS2322: Type '{ property1: string; property2: number; }' is not assignable to type 'AnotherComponentProps'.
!!! error TS2322: Property 'AnotherProperty1' is missing in type '{ property1: string; property2: number; }'.
!!! error TS2322: Type '{ property1: string; property2: number; }' is not assignable to type 'AnotherComponentProps'.
!!! error TS2322: Property 'AnotherProperty1' is missing in type '{ property1: string; property2: number; }'.
);
}
@@ -1,21 +1,17 @@
tests/cases/conformance/jsx/file.tsx(17,10): error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & PoisonedProp & { children?: ReactNode; }'.
Type '{}' is not assignable to type 'PoisonedProp'.
Property 'x' is missing in type '{}'.
tests/cases/conformance/jsx/file.tsx(18,10): error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & PoisonedProp & { children?: ReactNode; }'.
Type '{}' is not assignable to type 'PoisonedProp'.
Property 'x' is missing in type '{}'.
tests/cases/conformance/jsx/file.tsx(17,10): error TS2322: Type '{}' is not assignable to type 'PoisonedProp'.
Property 'x' is missing in type '{}'.
tests/cases/conformance/jsx/file.tsx(18,10): error TS2322: Type '{}' is not assignable to type 'PoisonedProp'.
Property 'x' is missing in type '{}'.
tests/cases/conformance/jsx/file.tsx(19,19): error TS2326: Types of property 'x' are incompatible.
Type 'true' is not assignable to type 'string'.
tests/cases/conformance/jsx/file.tsx(19,21): error TS2326: Types of property 'y' are incompatible.
Type 'true' is not assignable to type '"2"'.
tests/cases/conformance/jsx/file.tsx(20,10): error TS2322: Type '{ x: number; y: "2"; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & PoisonedProp & { children?: ReactNode; }'.
Type '{ x: number; y: "2"; }' is not assignable to type 'PoisonedProp'.
Types of property 'x' are incompatible.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/jsx/file.tsx(21,11): error TS2322: Type '{ X: string; x: number; y: "2"; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & PoisonedProp & { children?: ReactNode; }'.
Type '{ X: string; x: number; y: "2"; }' is not assignable to type 'PoisonedProp'.
Types of property 'x' are incompatible.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/jsx/file.tsx(20,10): error TS2322: Type '{ x: number; y: "2"; }' is not assignable to type 'PoisonedProp'.
Types of property 'x' are incompatible.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/jsx/file.tsx(21,11): error TS2322: Type '{ X: string; x: number; y: "2"; }' is not assignable to type 'PoisonedProp'.
Types of property 'x' are incompatible.
Type 'number' is not assignable to type 'string'.
==== tests/cases/conformance/jsx/file.tsx (6 errors) ====
@@ -37,14 +33,12 @@ tests/cases/conformance/jsx/file.tsx(21,11): error TS2322: Type '{ X: string; x:
// Error
let p = <Poisoned {...obj} />;
~~~~~~~~
!!! error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & PoisonedProp & { children?: ReactNode; }'.
!!! error TS2322: Type '{}' is not assignable to type 'PoisonedProp'.
!!! error TS2322: Property 'x' is missing in type '{}'.
!!! error TS2322: Type '{}' is not assignable to type 'PoisonedProp'.
!!! error TS2322: Property 'x' is missing in type '{}'.
let y = <Poisoned />;
~~~~~~~~
!!! error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & PoisonedProp & { children?: ReactNode; }'.
!!! error TS2322: Type '{}' is not assignable to type 'PoisonedProp'.
!!! error TS2322: Property 'x' is missing in type '{}'.
!!! error TS2322: Type '{}' is not assignable to type 'PoisonedProp'.
!!! error TS2322: Property 'x' is missing in type '{}'.
let z = <Poisoned x y/>;
~
!!! error TS2326: Types of property 'x' are incompatible.
@@ -54,13 +48,11 @@ tests/cases/conformance/jsx/file.tsx(21,11): error TS2322: Type '{ X: string; x:
!!! error TS2326: Type 'true' is not assignable to type '"2"'.
let w = <Poisoned {...{x: 5, y: "2"}}/>;
~~~~~~~~
!!! error TS2322: Type '{ x: number; y: "2"; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & PoisonedProp & { children?: ReactNode; }'.
!!! error TS2322: Type '{ x: number; y: "2"; }' is not assignable to type 'PoisonedProp'.
!!! error TS2322: Types of property 'x' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! error TS2322: Type '{ x: number; y: "2"; }' is not assignable to type 'PoisonedProp'.
!!! error TS2322: Types of property 'x' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
let w1 = <Poisoned {...{x: 5, y: "2"}} X="hi" />;
~~~~~~~~
!!! error TS2322: Type '{ X: string; x: number; y: "2"; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & PoisonedProp & { children?: ReactNode; }'.
!!! error TS2322: Type '{ X: string; x: number; y: "2"; }' is not assignable to type 'PoisonedProp'.
!!! error TS2322: Types of property 'x' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! error TS2322: Type '{ X: string; x: number; y: "2"; }' is not assignable to type 'PoisonedProp'.
!!! error TS2322: Types of property 'x' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
@@ -1,7 +1,6 @@
tests/cases/conformance/jsx/file.tsx(20,10): error TS2322: Type '{ x: string; y: number; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & PoisonedProp & { children?: ReactNode; }'.
Type '{ x: string; y: number; }' is not assignable to type 'PoisonedProp'.
Types of property 'y' are incompatible.
Type 'number' is not assignable to type '2'.
tests/cases/conformance/jsx/file.tsx(20,10): error TS2322: Type '{ x: string; y: number; }' is not assignable to type 'PoisonedProp'.
Types of property 'y' are incompatible.
Type 'number' is not assignable to type '2'.
tests/cases/conformance/jsx/file.tsx(33,10): error TS2559: Type '{ prop1: boolean; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<EmptyProp> & { children?: ReactNode; }'.
@@ -27,10 +26,9 @@ tests/cases/conformance/jsx/file.tsx(33,10): error TS2559: Type '{ prop1: boolea
// Error as "obj" has type { x: string; y: number }
let p = <Poisoned {...obj} />;
~~~~~~~~
!!! error TS2322: Type '{ x: string; y: number; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & PoisonedProp & { children?: ReactNode; }'.
!!! error TS2322: Type '{ x: string; y: number; }' is not assignable to type 'PoisonedProp'.
!!! error TS2322: Types of property 'y' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type '2'.
!!! error TS2322: Type '{ x: string; y: number; }' is not assignable to type 'PoisonedProp'.
!!! error TS2322: Types of property 'y' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type '2'.
class EmptyProp extends React.Component<{}, {}> {
render() {
@@ -1,7 +1,6 @@
tests/cases/conformance/jsx/file.tsx(13,10): error TS2322: Type '{ editable: true; }' is not assignable to type '(IntrinsicAttributes & IntrinsicClassAttributes<TextComponent> & { editable: false; } & { children?: ReactNode; }) | (IntrinsicAttributes & IntrinsicClassAttributes<TextComponent> & { editable: true; onEdit: (newText: string) => void; } & { children?: ReactNode; })'.
Type '{ editable: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<TextComponent> & { editable: true; onEdit: (newText: string) => void; } & { children?: ReactNode; }'.
Type '{ editable: true; }' is not assignable to type '{ editable: true; onEdit: (newText: string) => void; }'.
Property 'onEdit' is missing in type '{ editable: true; }'.
Type '{ editable: true; }' is not assignable to type '{ editable: true; onEdit: (newText: string) => void; }'.
Property 'onEdit' is missing in type '{ editable: true; }'.
==== tests/cases/conformance/jsx/file.tsx (1 errors) ====
@@ -20,9 +19,8 @@ tests/cases/conformance/jsx/file.tsx(13,10): error TS2322: Type '{ editable: tru
let x = <TextComponent editable={true} />
~~~~~~~~~~~~~
!!! error TS2322: Type '{ editable: true; }' is not assignable to type '(IntrinsicAttributes & IntrinsicClassAttributes<TextComponent> & { editable: false; } & { children?: ReactNode; }) | (IntrinsicAttributes & IntrinsicClassAttributes<TextComponent> & { editable: true; onEdit: (newText: string) => void; } & { children?: ReactNode; })'.
!!! error TS2322: Type '{ editable: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<TextComponent> & { editable: true; onEdit: (newText: string) => void; } & { children?: ReactNode; }'.
!!! error TS2322: Type '{ editable: true; }' is not assignable to type '{ editable: true; onEdit: (newText: string) => void; }'.
!!! error TS2322: Property 'onEdit' is missing in type '{ editable: true; }'.
!!! error TS2322: Type '{ editable: true; }' is not assignable to type '{ editable: true; onEdit: (newText: string) => void; }'.
!!! error TS2322: Property 'onEdit' is missing in type '{ editable: true; }'.
const textProps: TextProps = {
editable: false
@@ -1,19 +1,15 @@
tests/cases/conformance/jsx/file.tsx(12,13): error TS2322: Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
Type '{ extraProp: true; }' is not assignable to type '{ yy: number; yy1: string; }'.
Property 'yy' is missing in type '{ extraProp: true; }'.
tests/cases/conformance/jsx/file.tsx(13,13): error TS2322: Type '{ yy: number; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
Type '{ yy: number; }' is not assignable to type '{ yy: number; yy1: string; }'.
Property 'yy1' is missing in type '{ yy: number; }'.
tests/cases/conformance/jsx/file.tsx(12,13): error TS2322: Type '{ extraProp: true; }' is not assignable to type '{ yy: number; yy1: string; }'.
Property 'yy' is missing in type '{ extraProp: true; }'.
tests/cases/conformance/jsx/file.tsx(13,13): error TS2322: Type '{ yy: number; }' is not assignable to type '{ yy: number; yy1: string; }'.
Property 'yy1' is missing in type '{ yy: number; }'.
tests/cases/conformance/jsx/file.tsx(14,31): error TS2326: Types of property 'yy1' are incompatible.
Type 'true' is not assignable to type 'string'.
tests/cases/conformance/jsx/file.tsx(16,31): error TS2339: Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
tests/cases/conformance/jsx/file.tsx(17,13): error TS2322: Type '{ yy: boolean; yy1: string; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
Type '{ yy: boolean; yy1: string; }' is not assignable to type '{ yy: number; yy1: string; }'.
Types of property 'yy' are incompatible.
Type 'boolean' is not assignable to type 'number'.
tests/cases/conformance/jsx/file.tsx(25,13): error TS2322: Type '{ extra-data: true; }' is not assignable to type 'IntrinsicAttributes & { yy: string; direction?: number; }'.
Type '{ extra-data: true; }' is not assignable to type '{ yy: string; direction?: number; }'.
Property 'yy' is missing in type '{ extra-data: true; }'.
tests/cases/conformance/jsx/file.tsx(17,13): error TS2322: Type '{ yy: boolean; yy1: string; }' is not assignable to type '{ yy: number; yy1: string; }'.
Types of property 'yy' are incompatible.
Type 'boolean' is not assignable to type 'number'.
tests/cases/conformance/jsx/file.tsx(25,13): error TS2322: Type '{ extra-data: true; }' is not assignable to type '{ yy: string; direction?: number; }'.
Property 'yy' is missing in type '{ extra-data: true; }'.
tests/cases/conformance/jsx/file.tsx(26,40): error TS2326: Types of property 'direction' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/jsx/file.tsx(33,32): error TS2326: Types of property 'y3' are incompatible.
@@ -40,14 +36,12 @@ tests/cases/conformance/jsx/file.tsx(36,29): error TS2326: Types of property 'y1
// Error
const c0 = <OneThing extraProp />; // extra property;
~~~~~~~~
!!! error TS2322: Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
!!! error TS2322: Type '{ extraProp: true; }' is not assignable to type '{ yy: number; yy1: string; }'.
!!! error TS2322: Property 'yy' is missing in type '{ extraProp: true; }'.
!!! error TS2322: Type '{ extraProp: true; }' is not assignable to type '{ yy: number; yy1: string; }'.
!!! error TS2322: Property 'yy' is missing in type '{ extraProp: true; }'.
const c1 = <OneThing yy={10}/>; // missing property;
~~~~~~~~
!!! error TS2322: Type '{ yy: number; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
!!! error TS2322: Type '{ yy: number; }' is not assignable to type '{ yy: number; yy1: string; }'.
!!! error TS2322: Property 'yy1' is missing in type '{ yy: number; }'.
!!! error TS2322: Type '{ yy: number; }' is not assignable to type '{ yy: number; yy1: string; }'.
!!! error TS2322: Property 'yy1' is missing in type '{ yy: number; }'.
const c2 = <OneThing {...obj} yy1 />; // type incompatible;
~~~
!!! error TS2326: Types of property 'yy1' are incompatible.
@@ -58,10 +52,9 @@ tests/cases/conformance/jsx/file.tsx(36,29): error TS2326: Types of property 'y1
!!! error TS2339: Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
const c5 = <OneThing {...obj} {...{yy: true}} />; // type incompatible;
~~~~~~~~
!!! error TS2322: Type '{ yy: boolean; yy1: string; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
!!! error TS2322: Type '{ yy: boolean; yy1: string; }' is not assignable to type '{ yy: number; yy1: string; }'.
!!! error TS2322: Types of property 'yy' are incompatible.
!!! error TS2322: Type 'boolean' is not assignable to type 'number'.
!!! error TS2322: Type '{ yy: boolean; yy1: string; }' is not assignable to type '{ yy: number; yy1: string; }'.
!!! error TS2322: Types of property 'yy' are incompatible.
!!! error TS2322: Type 'boolean' is not assignable to type 'number'.
const c6 = <OneThing {...obj2} {...{extra: "extra attr"}} />; // Should error as there is extra attribute that doesn't match any. Current it is not
const c7 = <OneThing {...obj2} yy />; // Should error as there is extra attribute that doesn't match any. Current it is not
@@ -71,9 +64,8 @@ tests/cases/conformance/jsx/file.tsx(36,29): error TS2326: Types of property 'y1
// Error
const d1 = <TestingOneThing extra-data />
~~~~~~~~~~~~~~~
!!! error TS2322: Type '{ extra-data: true; }' is not assignable to type 'IntrinsicAttributes & { yy: string; direction?: number; }'.
!!! error TS2322: Type '{ extra-data: true; }' is not assignable to type '{ yy: string; direction?: number; }'.
!!! error TS2322: Property 'yy' is missing in type '{ extra-data: true; }'.
!!! error TS2322: Type '{ extra-data: true; }' is not assignable to type '{ yy: string; direction?: number; }'.
!!! error TS2322: Property 'yy' is missing in type '{ extra-data: true; }'.
const d2 = <TestingOneThing yy="hello" direction="left" />
~~~~~~~~~~~~~~~~
!!! error TS2326: Types of property 'direction' are incompatible.
@@ -1,18 +1,13 @@
tests/cases/conformance/jsx/file.tsx(48,13): error TS2322: Type '{ children: string; to: string; onClick: (e: MouseEvent<any>) => void; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'.
Type '{ children: string; to: string; onClick: (e: MouseEvent<any>) => void; }' is not assignable to type 'HyphenProps'.
Property '"data-format"' is missing in type '{ children: string; to: string; onClick: (e: MouseEvent<any>) => void; }'.
tests/cases/conformance/jsx/file.tsx(49,13): error TS2322: Type '{ children: string; to: string; onClick: (e: any) => void; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'.
Type '{ children: string; to: string; onClick: (e: any) => void; }' is not assignable to type 'HyphenProps'.
Property '"data-format"' is missing in type '{ children: string; to: string; onClick: (e: any) => void; }'.
tests/cases/conformance/jsx/file.tsx(50,13): error TS2322: Type '{ onClick: () => void; to: string; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'.
Type '{ onClick: () => void; to: string; }' is not assignable to type 'HyphenProps'.
Property '"data-format"' is missing in type '{ onClick: () => void; to: string; }'.
tests/cases/conformance/jsx/file.tsx(51,13): error TS2322: Type '{ onClick: (k: MouseEvent<any>) => void; to: string; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'.
Type '{ onClick: (k: MouseEvent<any>) => void; to: string; }' is not assignable to type 'HyphenProps'.
Property '"data-format"' is missing in type '{ onClick: (k: MouseEvent<any>) => void; to: string; }'.
tests/cases/conformance/jsx/file.tsx(53,13): error TS2322: Type '{ to: string; onClick(e: any): void; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'.
Type '{ to: string; onClick(e: any): void; }' is not assignable to type 'HyphenProps'.
Property '"data-format"' is missing in type '{ to: string; onClick(e: any): void; }'.
tests/cases/conformance/jsx/file.tsx(48,13): error TS2322: Type '{ children: string; to: string; onClick: (e: MouseEvent<any>) => void; }' is not assignable to type 'HyphenProps'.
Property '"data-format"' is missing in type '{ children: string; to: string; onClick: (e: MouseEvent<any>) => void; }'.
tests/cases/conformance/jsx/file.tsx(49,13): error TS2322: Type '{ children: string; to: string; onClick: (e: any) => void; }' is not assignable to type 'HyphenProps'.
Property '"data-format"' is missing in type '{ children: string; to: string; onClick: (e: any) => void; }'.
tests/cases/conformance/jsx/file.tsx(50,13): error TS2322: Type '{ onClick: () => void; to: string; }' is not assignable to type 'HyphenProps'.
Property '"data-format"' is missing in type '{ onClick: () => void; to: string; }'.
tests/cases/conformance/jsx/file.tsx(51,13): error TS2322: Type '{ onClick: (k: MouseEvent<any>) => void; to: string; }' is not assignable to type 'HyphenProps'.
Property '"data-format"' is missing in type '{ onClick: (k: MouseEvent<any>) => void; to: string; }'.
tests/cases/conformance/jsx/file.tsx(53,13): error TS2322: Type '{ to: string; onClick(e: any): void; }' is not assignable to type 'HyphenProps'.
Property '"data-format"' is missing in type '{ to: string; onClick(e: any): void; }'.
tests/cases/conformance/jsx/file.tsx(54,51): error TS2326: Types of property 'children' are incompatible.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/jsx/file.tsx(55,68): error TS2326: Types of property 'className' are incompatible.
@@ -71,30 +66,25 @@ tests/cases/conformance/jsx/file.tsx(56,24): error TS2326: Types of property 'da
// Error
const b0 = <MainButton to='/some/path' onClick={(e)=>{}}>GO</MainButton>; // extra property;
~~~~~~~~~~
!!! error TS2322: Type '{ children: string; to: string; onClick: (e: MouseEvent<any>) => void; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'.
!!! error TS2322: Type '{ children: string; to: string; onClick: (e: MouseEvent<any>) => void; }' is not assignable to type 'HyphenProps'.
!!! error TS2322: Property '"data-format"' is missing in type '{ children: string; to: string; onClick: (e: MouseEvent<any>) => void; }'.
!!! error TS2322: Type '{ children: string; to: string; onClick: (e: MouseEvent<any>) => void; }' is not assignable to type 'HyphenProps'.
!!! error TS2322: Property '"data-format"' is missing in type '{ children: string; to: string; onClick: (e: MouseEvent<any>) => void; }'.
const b1 = <MainButton onClick={(e: any)=> {}} {...obj0}>Hello world</MainButton>; // extra property;
~~~~~~~~~~
!!! error TS2322: Type '{ children: string; to: string; onClick: (e: any) => void; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'.
!!! error TS2322: Type '{ children: string; to: string; onClick: (e: any) => void; }' is not assignable to type 'HyphenProps'.
!!! error TS2322: Property '"data-format"' is missing in type '{ children: string; to: string; onClick: (e: any) => void; }'.
!!! error TS2322: Type '{ children: string; to: string; onClick: (e: any) => void; }' is not assignable to type 'HyphenProps'.
!!! error TS2322: Property '"data-format"' is missing in type '{ children: string; to: string; onClick: (e: any) => void; }'.
const b2 = <MainButton {...{to: "10000"}} {...obj2} />; // extra property
~~~~~~~~~~
!!! error TS2322: Type '{ onClick: () => void; to: string; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'.
!!! error TS2322: Type '{ onClick: () => void; to: string; }' is not assignable to type 'HyphenProps'.
!!! error TS2322: Property '"data-format"' is missing in type '{ onClick: () => void; to: string; }'.
!!! error TS2322: Type '{ onClick: () => void; to: string; }' is not assignable to type 'HyphenProps'.
!!! error TS2322: Property '"data-format"' is missing in type '{ onClick: () => void; to: string; }'.
const b3 = <MainButton {...{to: "10000"}} {...{onClick: (k) => {}}} />; // extra property
~~~~~~~~~~
!!! error TS2322: Type '{ onClick: (k: MouseEvent<any>) => void; to: string; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'.
!!! error TS2322: Type '{ onClick: (k: MouseEvent<any>) => void; to: string; }' is not assignable to type 'HyphenProps'.
!!! error TS2322: Property '"data-format"' is missing in type '{ onClick: (k: MouseEvent<any>) => void; to: string; }'.
!!! error TS2322: Type '{ onClick: (k: MouseEvent<any>) => void; to: string; }' is not assignable to type 'HyphenProps'.
!!! error TS2322: Property '"data-format"' is missing in type '{ onClick: (k: MouseEvent<any>) => void; to: string; }'.
const b4 = <MainButton {...obj3} to />; // Should error because Incorrect type; but attributes are any so everything is allowed
const b5 = <MainButton {...{ onClick(e: any) { } }} {...obj0} />; // Spread retain method declaration (see GitHub #13365), so now there is an extra attributes
~~~~~~~~~~
!!! error TS2322: Type '{ to: string; onClick(e: any): void; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'.
!!! error TS2322: Type '{ to: string; onClick(e: any): void; }' is not assignable to type 'HyphenProps'.
!!! error TS2322: Property '"data-format"' is missing in type '{ to: string; onClick(e: any): void; }'.
!!! error TS2322: Type '{ to: string; onClick(e: any): void; }' is not assignable to type 'HyphenProps'.
!!! error TS2322: Property '"data-format"' is missing in type '{ to: string; onClick(e: any): void; }'.
const b6 = <MainButton {...{ onClick(e: any){} }} children={10} />; // incorrect type for optional attribute
~~~~~~~~~~~~~
!!! error TS2326: Types of property 'children' are incompatible.
@@ -1,12 +1,10 @@
tests/cases/conformance/jsx/file.tsx(19,10): error TS2322: Type '{ naaame: string; }' is not assignable to type 'IntrinsicAttributes & { name: string; }'.
Type '{ naaame: string; }' is not assignable to type '{ name: string; }'.
Property 'name' is missing in type '{ naaame: string; }'.
tests/cases/conformance/jsx/file.tsx(19,10): error TS2322: Type '{ naaame: string; }' is not assignable to type '{ name: string; }'.
Property 'name' is missing in type '{ naaame: string; }'.
tests/cases/conformance/jsx/file.tsx(27,15): error TS2326: Types of property 'name' are incompatible.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/jsx/file.tsx(29,10): error TS2559: Type '{ naaaaaaame: string; }' has no properties in common with type 'IntrinsicAttributes & { name?: string; }'.
tests/cases/conformance/jsx/file.tsx(34,10): error TS2322: Type '{ extra-prop-name: string; }' is not assignable to type 'IntrinsicAttributes & { "prop-name": string; }'.
Type '{ extra-prop-name: string; }' is not assignable to type '{ "prop-name": string; }'.
Property '"prop-name"' is missing in type '{ extra-prop-name: string; }'.
tests/cases/conformance/jsx/file.tsx(34,10): error TS2322: Type '{ extra-prop-name: string; }' is not assignable to type '{ "prop-name": string; }'.
Property '"prop-name"' is missing in type '{ extra-prop-name: string; }'.
tests/cases/conformance/jsx/file.tsx(37,10): error TS2559: Type '{ prop1: true; }' has no properties in common with type 'IntrinsicAttributes'.
tests/cases/conformance/jsx/file.tsx(38,11): error TS2559: Type '{ ref: (x: any) => any; }' has no properties in common with type 'IntrinsicAttributes'.
tests/cases/conformance/jsx/file.tsx(41,16): error TS1005: ',' expected.
@@ -34,9 +32,8 @@ tests/cases/conformance/jsx/file.tsx(45,11): error TS2559: Type '{ prop1: boolea
// Error
let b = <Greet naaame='world' />;
~~~~~
!!! error TS2322: Type '{ naaame: string; }' is not assignable to type 'IntrinsicAttributes & { name: string; }'.
!!! error TS2322: Type '{ naaame: string; }' is not assignable to type '{ name: string; }'.
!!! error TS2322: Property 'name' is missing in type '{ naaame: string; }'.
!!! error TS2322: Type '{ naaame: string; }' is not assignable to type '{ name: string; }'.
!!! error TS2322: Property 'name' is missing in type '{ naaame: string; }'.
// OK
let c = <Meet />;
@@ -58,9 +55,8 @@ tests/cases/conformance/jsx/file.tsx(45,11): error TS2559: Type '{ prop1: boolea
// Error
let h = <MeetAndGreet extra-prop-name="World" />;
~~~~~~~~~~~~
!!! error TS2322: Type '{ extra-prop-name: string; }' is not assignable to type 'IntrinsicAttributes & { "prop-name": string; }'.
!!! error TS2322: Type '{ extra-prop-name: string; }' is not assignable to type '{ "prop-name": string; }'.
!!! error TS2322: Property '"prop-name"' is missing in type '{ extra-prop-name: string; }'.
!!! error TS2322: Type '{ extra-prop-name: string; }' is not assignable to type '{ "prop-name": string; }'.
!!! error TS2322: Property '"prop-name"' is missing in type '{ extra-prop-name: string; }'.
// Error
let i = <EmptyPropSFC prop1 />
@@ -1,6 +1,5 @@
tests/cases/conformance/jsx/file.tsx(9,15): error TS2322: Type '{ a: number; }' is not assignable to type 'IntrinsicAttributes & { b: {}; a: number; }'.
Type '{ a: number; }' is not assignable to type '{ b: {}; a: number; }'.
Property 'b' is missing in type '{ a: number; }'.
tests/cases/conformance/jsx/file.tsx(9,15): error TS2322: Type '{ a: number; }' is not assignable to type '{ b: {}; a: number; }'.
Property 'b' is missing in type '{ a: number; }'.
tests/cases/conformance/jsx/file.tsx(10,15): error TS2322: Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: {}; a: {}; }'.
Type 'T & { ignore-prop: true; }' is not assignable to type '{ b: {}; a: {}; }'.
Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }'.
@@ -17,9 +16,8 @@ tests/cases/conformance/jsx/file.tsx(10,15): error TS2322: Type 'T & { ignore-pr
function Baz<T extends {b: number}, U extends {a: boolean, b:string}>(arg1: T, arg2: U) {
let a0 = <OverloadComponent a={arg1.b}/>
~~~~~~~~~~~~~~~~~
!!! error TS2322: Type '{ a: number; }' is not assignable to type 'IntrinsicAttributes & { b: {}; a: number; }'.
!!! error TS2322: Type '{ a: number; }' is not assignable to type '{ b: {}; a: number; }'.
!!! error TS2322: Property 'b' is missing in type '{ a: number; }'.
!!! error TS2322: Type '{ a: number; }' is not assignable to type '{ b: {}; a: number; }'.
!!! error TS2322: Property 'b' is missing in type '{ a: number; }'.
let a2 = <OverloadComponent {...arg1} ignore-prop /> // missing a
~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: {}; a: {}; }'.
@@ -1,12 +1,10 @@
tests/cases/conformance/jsx/file.tsx(18,10): error TS2559: Type '{ x: true; }' has no properties in common with type 'IntrinsicAttributes'.
tests/cases/conformance/jsx/file.tsx(19,27): error TS2326: Types of property 'x' are incompatible.
Type 'string' is not assignable to type 'boolean'.
tests/cases/conformance/jsx/file.tsx(20,10): error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & { x: boolean; }'.
Type '{}' is not assignable to type '{ x: boolean; }'.
Property 'x' is missing in type '{}'.
tests/cases/conformance/jsx/file.tsx(21,10): error TS2322: Type '{ data-prop: true; }' is not assignable to type 'IntrinsicAttributes & { x: boolean; }'.
Type '{ data-prop: true; }' is not assignable to type '{ x: boolean; }'.
Property 'x' is missing in type '{ data-prop: true; }'.
tests/cases/conformance/jsx/file.tsx(20,10): error TS2322: Type '{}' is not assignable to type '{ x: boolean; }'.
Property 'x' is missing in type '{}'.
tests/cases/conformance/jsx/file.tsx(21,10): error TS2322: Type '{ data-prop: true; }' is not assignable to type '{ x: boolean; }'.
Property 'x' is missing in type '{ data-prop: true; }'.
==== tests/cases/conformance/jsx/file.tsx (4 errors) ====
@@ -36,13 +34,11 @@ tests/cases/conformance/jsx/file.tsx(21,10): error TS2322: Type '{ data-prop: tr
!!! error TS2326: Type 'string' is not assignable to type 'boolean'.
let c = <SFC2AndEmptyComp />;
~~~~~~~~~~~~~~~~
!!! error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & { x: boolean; }'.
!!! error TS2322: Type '{}' is not assignable to type '{ x: boolean; }'.
!!! error TS2322: Property 'x' is missing in type '{}'.
!!! error TS2322: Type '{}' is not assignable to type '{ x: boolean; }'.
!!! error TS2322: Property 'x' is missing in type '{}'.
let d = <SFC2AndEmptyComp data-prop />;
~~~~~~~~~~~~~~~~
!!! error TS2322: Type '{ data-prop: true; }' is not assignable to type 'IntrinsicAttributes & { x: boolean; }'.
!!! error TS2322: Type '{ data-prop: true; }' is not assignable to type '{ x: boolean; }'.
!!! error TS2322: Property 'x' is missing in type '{ data-prop: true; }'.
!!! error TS2322: Type '{ data-prop: true; }' is not assignable to type '{ x: boolean; }'.
!!! error TS2322: Property 'x' is missing in type '{ data-prop: true; }'.
@@ -0,0 +1,31 @@
// @jsx: preserve
declare namespace JSX {
interface Element { }
interface ElementClass {
render: any;
}
interface IntrinsicAttributes {
key: string | number
}
interface IntrinsicClassAttributes<T> {
ref: T
}
interface IntrinsicElements {
div: {
text?: string;
width?: number;
}
span: any;
}
}
interface I {
new(n: string): {
x: number
render(): void
}
}
var E: I;
<E x={10} />
@@ -0,0 +1,10 @@
// @checkJs: true
// @allowJS: true
// @noEmit: true
// @Filename: bug24062.js
// #24062
class C {
}
module.exports = {
C
};
@@ -7,6 +7,21 @@
//// const x = 0;
////}
////function g(a, b, c) { return a; }
////
////interface I {
//// m(x: number): void;
////}
////
////class C implements I {
//// m(x: number): void {} // Does not remove 'x', which is inherited
//// n(x: number): void {}
////}
////
////declare function f(cb: (x: number, y: string) => void): void;
////f((x, y) => {});
////f((x, y) => { x; });
////f((x, y) => { y; });
////
////{
//// let a, b;
////}
@@ -19,6 +34,21 @@ verify.codeFixAll({
`function f() {
}
function g(a) { return a; }
interface I {
m(x: number): void;
}
class C implements I {
m(x: number): void {} // Does not remove 'x', which is inherited
n(): void {}
}
declare function f(cb: (x: number, y: string) => void): void;
f(() => {});
f((x) => { x; });
f((x, y) => { y; });
{
}
for (; ;) {}`,
@@ -6,7 +6,7 @@
////const { x, y } = o;
////const { a, b } = o;
////a;
////export function f({ x, y }, { a, b }) {
////export function f({ a, b }, { x, y }) {
//// a;
////}
@@ -0,0 +1,9 @@
/// <reference path='fourslash.ts' />
// @noUnusedParameters: true
////declare function f(cb: (x: number, y: string) => void): void;
////f((x, y) => { y; });
// No codefix to remove a non-last parameter
verify.codeFixAvailable([{ description: "Prefix 'x' with an underscore" }]);
@@ -0,0 +1,14 @@
/// <reference path='fourslash.ts' />
// @noUnusedParameters: true
////interface I {
//// m(x: number): void;
////}
////
////class C implements I {
//// m(x: number): void {}
////}
// No codefix to remove the parameter, it's inherited
verify.codeFixAvailable([{ description: "Prefix 'x' with an underscore" }]);

Some files were not shown because too many files have changed in this diff Show More