mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 01:49:57 -05:00
Merge branch 'master' into exportDefaultType
Conflicts: src/compiler/checker.ts
This commit is contained in:
15
tests/cases/compiler/letConstMatchingParameterNames.ts
Normal file
15
tests/cases/compiler/letConstMatchingParameterNames.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
// @target: es5
|
||||
let parent = true;
|
||||
const parent2 = true;
|
||||
declare function use(a: any);
|
||||
|
||||
function a() {
|
||||
|
||||
let parent = 1;
|
||||
const parent2 = 2;
|
||||
|
||||
function b(parent: string, parent2: number) {
|
||||
use(parent);
|
||||
use(parent2);
|
||||
}
|
||||
}
|
||||
2
tests/cases/compiler/letInNonStrictMode.ts
Normal file
2
tests/cases/compiler/letInNonStrictMode.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
let [x] = [1];
|
||||
let {a: y} = {a: 1};
|
||||
@@ -0,0 +1,10 @@
|
||||
if (true) {
|
||||
let x;
|
||||
if (true) {
|
||||
var x = 0; // Error
|
||||
var { x = 0 } = { x: 0 }; // Error
|
||||
var { x: x = 0 } = { x: 0 }; // Error
|
||||
var { x } = { x: 0 }; // Error
|
||||
var { x: x } = { x: 0 }; // Error
|
||||
}
|
||||
}
|
||||
24
tests/cases/fourslash/navbar_exportDefault.ts
Normal file
24
tests/cases/fourslash/navbar_exportDefault.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @Filename: a.ts
|
||||
//// {| "itemName": "default", "kind": "class", "parentName": "" |}export default class { }
|
||||
|
||||
// @Filename: b.ts
|
||||
//// {| "itemName": "C", "kind": "class", "parentName": "" |}export default class C { }
|
||||
|
||||
// @Filename: c.ts
|
||||
//// {| "itemName": "default", "kind": "function", "parentName": "" |}export default function { }
|
||||
|
||||
// @Filename: d.ts
|
||||
//// {| "itemName": "Func", "kind": "function", "parentName": "" |}export default function Func { }
|
||||
|
||||
test.markers().forEach(marker => {
|
||||
goTo.file(marker.fileName);
|
||||
verify.getScriptLexicalStructureListContains(
|
||||
marker.data.itemName,
|
||||
marker.data.kind,
|
||||
marker.fileName,
|
||||
marker.data.parentName,
|
||||
marker.data.isAdditionalRange,
|
||||
marker.position);
|
||||
});
|
||||
Reference in New Issue
Block a user