mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-29 16:29:19 -05:00
Merge branch 'master' into semanticBindingPropNames
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
tests/cases/compiler/numLit.ts(3,3): error TS1005: ';' expected.
|
||||
tests/cases/compiler/numLit.ts(9,15): error TS1005: ',' expected.
|
||||
tests/cases/compiler/numLit.ts(9,23): error TS1005: '=' expected.
|
||||
tests/cases/compiler/numLit.ts(9,24): error TS1109: Expression expected.
|
||||
tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts(3,3): error TS1005: ';' expected.
|
||||
tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts(9,15): error TS1005: ',' expected.
|
||||
tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts(9,23): error TS1005: '=' expected.
|
||||
tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts(9,24): error TS1109: Expression expected.
|
||||
|
||||
|
||||
==== tests/cases/compiler/numLit.ts (4 errors) ====
|
||||
==== tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts (4 errors) ====
|
||||
1..toString();
|
||||
1.0.toString();
|
||||
1.toString();
|
||||
@@ -15,7 +15,7 @@ tests/cases/compiler/numLit.ts(9,24): error TS1109: Expression expected.
|
||||
// Preserve whitespace where important for JS compatibility
|
||||
var i: number = 1;
|
||||
var test1 = i.toString();
|
||||
var test2 = 2.toString(); // emitted as 2 .toString()
|
||||
var test2 = 2.toString();
|
||||
~~~~~~~~
|
||||
!!! error TS1005: ',' expected.
|
||||
~
|
||||
@@ -1,4 +1,4 @@
|
||||
//// [numLit.ts]
|
||||
//// [numericLiteralsWithTrailingDecimalPoints01.ts]
|
||||
1..toString();
|
||||
1.0.toString();
|
||||
1.toString();
|
||||
@@ -7,7 +7,7 @@
|
||||
// Preserve whitespace where important for JS compatibility
|
||||
var i: number = 1;
|
||||
var test1 = i.toString();
|
||||
var test2 = 2.toString(); // emitted as 2 .toString()
|
||||
var test2 = 2.toString();
|
||||
var test3 = 3 .toString();
|
||||
var test4 = 3 .toString();
|
||||
var test5 = 3 .toString();
|
||||
@@ -18,7 +18,7 @@ var test8 = new Number(4).toString();
|
||||
var test9 = 3. + 3.
|
||||
|
||||
|
||||
//// [numLit.js]
|
||||
//// [numericLiteralsWithTrailingDecimalPoints01.js]
|
||||
1..toString();
|
||||
1.0.toString();
|
||||
1.;
|
||||
@@ -27,7 +27,7 @@ toString();
|
||||
// Preserve whitespace where important for JS compatibility
|
||||
var i = 1;
|
||||
var test1 = i.toString();
|
||||
var test2 = 2., toString = (); // emitted as 2 .toString()
|
||||
var test2 = 2., toString = ();
|
||||
var test3 = 3 .toString();
|
||||
var test4 = 3 .toString();
|
||||
var test5 = 3 .toString();
|
||||
@@ -6,7 +6,7 @@
|
||||
// Preserve whitespace where important for JS compatibility
|
||||
var i: number = 1;
|
||||
var test1 = i.toString();
|
||||
var test2 = 2.toString(); // emitted as 2 .toString()
|
||||
var test2 = 2.toString();
|
||||
var test3 = 3 .toString();
|
||||
var test4 = 3 .toString();
|
||||
var test5 = 3 .toString();
|
||||
18
tests/cases/fourslash/findAllRefsForDefaultExport01.ts
Normal file
18
tests/cases/fourslash/findAllRefsForDefaultExport01.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////export default class [|DefaultExportedClass|] {
|
||||
////}
|
||||
////
|
||||
////var x: [|DefaultExportedClass|];
|
||||
////
|
||||
////var y = new [|DefaultExportedClass|];
|
||||
|
||||
let ranges = test.ranges()
|
||||
for (let range of ranges) {
|
||||
goTo.position(range.start);
|
||||
|
||||
verify.referencesCountIs(ranges.length);
|
||||
for (let expectedReference of ranges) {
|
||||
verify.referencesAtPositionContains(expectedReference);
|
||||
}
|
||||
}
|
||||
19
tests/cases/fourslash/findAllRefsForDefaultExport02.ts
Normal file
19
tests/cases/fourslash/findAllRefsForDefaultExport02.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////export default function [|DefaultExportedFunction|]() {
|
||||
//// return [|DefaultExportedFunction|]
|
||||
////}
|
||||
////
|
||||
////var x: typeof [|DefaultExportedFunction|];
|
||||
////
|
||||
////var y = [|DefaultExportedFunction|]();
|
||||
|
||||
let ranges = test.ranges()
|
||||
for (let range of ranges) {
|
||||
goTo.position(range.start);
|
||||
|
||||
verify.referencesCountIs(ranges.length);
|
||||
for (let expectedReference of ranges) {
|
||||
verify.referencesAtPositionContains(expectedReference);
|
||||
}
|
||||
}
|
||||
25
tests/cases/fourslash/findAllRefsForDefaultExport03.ts
Normal file
25
tests/cases/fourslash/findAllRefsForDefaultExport03.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////function [|f|]() {
|
||||
//// return 100;
|
||||
////}
|
||||
////
|
||||
////export default [|f|];
|
||||
////
|
||||
////var x: typeof [|f|];
|
||||
////
|
||||
////var y = [|f|]();
|
||||
////
|
||||
////namespace [|f|] {
|
||||
//// var local = 100;
|
||||
////}
|
||||
|
||||
let ranges = test.ranges()
|
||||
for (let range of ranges) {
|
||||
goTo.position(range.start);
|
||||
|
||||
verify.referencesCountIs(ranges.length);
|
||||
for (let expectedReference of ranges) {
|
||||
verify.referencesAtPositionContains(expectedReference);
|
||||
}
|
||||
}
|
||||
28
tests/cases/fourslash/findAllRefsForDefaultExport04.ts
Normal file
28
tests/cases/fourslash/findAllRefsForDefaultExport04.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////function f() {
|
||||
//// return 100;
|
||||
////}
|
||||
////
|
||||
////export default [|f|];
|
||||
////
|
||||
////var x: typeof f;
|
||||
////
|
||||
////var y = f();
|
||||
////
|
||||
////namespace /**/[|f|] {
|
||||
////}
|
||||
|
||||
// The function 'f' and the namespace 'f' don't get merged,
|
||||
// but the 'export default' site, includes both meanings.
|
||||
|
||||
// Here we are testing whether the 'export default'
|
||||
// site is included in the references to the namespace.
|
||||
|
||||
goTo.marker();
|
||||
let ranges = test.ranges();
|
||||
verify.referencesCountIs(ranges.length);
|
||||
|
||||
for (let expectedReference of ranges) {
|
||||
verify.referencesAtPositionContains(expectedReference);
|
||||
}
|
||||
28
tests/cases/fourslash/findAllRefsForDefaultExport05.ts
Normal file
28
tests/cases/fourslash/findAllRefsForDefaultExport05.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////function /**/[|f|]() {
|
||||
//// return 100;
|
||||
////}
|
||||
////
|
||||
////export default [|f|];
|
||||
////
|
||||
////var x: typeof [|f|];
|
||||
////
|
||||
////var y = [|f|]();
|
||||
////
|
||||
////namespace f {
|
||||
////}
|
||||
|
||||
// The function 'f' and the namespace 'f' don't get merged,
|
||||
// but the 'export default' site, includes both meanings.
|
||||
|
||||
// Here we are testing whether the 'export default' site
|
||||
// and all value-uses of 'f' are included in the references to the function.
|
||||
|
||||
goTo.marker();
|
||||
let ranges = test.ranges();
|
||||
verify.referencesCountIs(ranges.length);
|
||||
|
||||
for (let expectedReference of ranges) {
|
||||
verify.referencesAtPositionContains(expectedReference);
|
||||
}
|
||||
28
tests/cases/fourslash/findAllRefsForDefaultExport06.ts
Normal file
28
tests/cases/fourslash/findAllRefsForDefaultExport06.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////function [|f|]() {
|
||||
//// return 100;
|
||||
////}
|
||||
////
|
||||
////export default /**/[|f|];
|
||||
////
|
||||
////var x: typeof [|f|];
|
||||
////
|
||||
////var y = [|f|]();
|
||||
////
|
||||
////namespace [|f|] {
|
||||
////}
|
||||
|
||||
// The function 'f' and the namespace 'f' don't get merged,
|
||||
// but the 'export default' site, includes both meanings.
|
||||
|
||||
// Here we are testing whether the 'export default' site
|
||||
// and all value-uses of 'f' are included in the references to the function.
|
||||
|
||||
goTo.marker();
|
||||
let ranges = test.ranges();
|
||||
verify.referencesCountIs(ranges.length);
|
||||
|
||||
for (let expectedReference of ranges) {
|
||||
verify.referencesAtPositionContains(expectedReference);
|
||||
}
|
||||
18
tests/cases/fourslash/findAllRefsForDefaultExport07.ts
Normal file
18
tests/cases/fourslash/findAllRefsForDefaultExport07.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////export default function DefaultExportedFunction() {
|
||||
//// return DefaultExportedFunction
|
||||
////}
|
||||
////
|
||||
////var x: typeof DefaultExportedFunction;
|
||||
////
|
||||
////var y = DefaultExportedFunction();
|
||||
////
|
||||
////namespace /**/DefaultExportedFunction {
|
||||
////}
|
||||
|
||||
// The namespace and function do not merge,
|
||||
// so the namespace should be all alone.
|
||||
|
||||
goTo.marker();
|
||||
verify.referencesCountIs(1);
|
||||
17
tests/cases/fourslash/findAllRefsForDefaultExport08.ts
Normal file
17
tests/cases/fourslash/findAllRefsForDefaultExport08.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////export default class DefaultExportedClass {
|
||||
////}
|
||||
////
|
||||
////var x: DefaultExportedClass;
|
||||
////
|
||||
////var y = new DefaultExportedClass;
|
||||
////
|
||||
////namespace /**/DefaultExportedClass {
|
||||
////}
|
||||
|
||||
// The namespace and class do not merge,
|
||||
// so the namespace should be all alone.
|
||||
|
||||
goTo.marker();
|
||||
verify.referencesCountIs(1);
|
||||
21
tests/cases/fourslash/findAllRefsForFunctionExpression01.ts
Normal file
21
tests/cases/fourslash/findAllRefsForFunctionExpression01.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
// @Filename: file1.ts
|
||||
////var foo = function [|foo|](a = [|foo|](), b = () => [|foo|]) {
|
||||
//// [|foo|]([|foo|], [|foo|]);
|
||||
////}
|
||||
|
||||
// @Filename: file2.ts
|
||||
/////// <reference path="file1.ts" />
|
||||
////foo();
|
||||
|
||||
|
||||
let ranges = test.ranges()
|
||||
for (let range of ranges) {
|
||||
goTo.position(range.start);
|
||||
|
||||
verify.referencesCountIs(ranges.length);
|
||||
for (let expectedReference of ranges) {
|
||||
verify.referencesAtPositionContains(expectedReference);
|
||||
}
|
||||
}
|
||||
12
tests/cases/fourslash/formattingOfExportDefault.ts
Normal file
12
tests/cases/fourslash/formattingOfExportDefault.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
/// <reference path="fourslash.ts"/>
|
||||
|
||||
////module Foo {
|
||||
/////*1*/ export default class Test { }
|
||||
////}
|
||||
/////*2*/export default function bar() { }
|
||||
|
||||
format.document();
|
||||
goTo.marker("1");
|
||||
verify.currentLineContentIs(" export default class Test { }")
|
||||
goTo.marker("2");
|
||||
verify.currentLineContentIs("export default function bar() { }")
|
||||
18
tests/cases/fourslash/renameForDefaultExport01.ts
Normal file
18
tests/cases/fourslash/renameForDefaultExport01.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////export default class /*1*/[|DefaultExportedClass|] {
|
||||
////}
|
||||
/////*
|
||||
//// * Commenting [|DefaultExportedClass|]
|
||||
//// */
|
||||
////
|
||||
////var x: /*2*/[|DefaultExportedClass|];
|
||||
////
|
||||
////var y = new /*3*/[|DefaultExportedClass|];
|
||||
|
||||
let markers = test.markers()
|
||||
for (let marker of markers) {
|
||||
goTo.position(marker.position);
|
||||
|
||||
verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ true);
|
||||
}
|
||||
19
tests/cases/fourslash/renameForDefaultExport02.ts
Normal file
19
tests/cases/fourslash/renameForDefaultExport02.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////export default function /*1*/[|DefaultExportedFunction|]() {
|
||||
//// return /*2*/[|DefaultExportedFunction|]
|
||||
////}
|
||||
/////**
|
||||
//// * Commenting [|DefaultExportedFunction|]
|
||||
//// */
|
||||
////
|
||||
////var x: typeof /*3*/[|DefaultExportedFunction|];
|
||||
////
|
||||
////var y = /*4*/[|DefaultExportedFunction|]();
|
||||
|
||||
let markers = test.markers()
|
||||
for (let marker of markers) {
|
||||
goTo.position(marker.position);
|
||||
|
||||
verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ true);
|
||||
}
|
||||
25
tests/cases/fourslash/renameForDefaultExport03.ts
Normal file
25
tests/cases/fourslash/renameForDefaultExport03.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////function /*1*/[|f|]() {
|
||||
//// return 100;
|
||||
////}
|
||||
////
|
||||
////export default /*2*/[|f|];
|
||||
////
|
||||
////var x: typeof /*3*/[|f|];
|
||||
////
|
||||
////var y = /*4*/[|f|]();
|
||||
////
|
||||
/////**
|
||||
//// * Commenting [|f|]
|
||||
//// */
|
||||
////namespace /*5*/[|f|] {
|
||||
//// var local = 100;
|
||||
////}
|
||||
|
||||
let markers = test.markers()
|
||||
for (let marker of markers) {
|
||||
goTo.position(marker.position);
|
||||
|
||||
verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ true);
|
||||
}
|
||||
15
tests/cases/fourslash/renameForDefaultExport04.ts
Normal file
15
tests/cases/fourslash/renameForDefaultExport04.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
// @Filename: foo.ts
|
||||
////export default class /**/[|DefaultExportedClass|] {
|
||||
////}
|
||||
/////*
|
||||
//// * Commenting DefaultExportedClass
|
||||
//// */
|
||||
////
|
||||
////var x: DefaultExportedClass;
|
||||
////
|
||||
////var y = new DefaultExportedClass;
|
||||
|
||||
goTo.marker();
|
||||
verify.renameInfoSucceeded("DefaultExportedClass", '"tests/cases/fourslash/foo".DefaultExportedClass');
|
||||
15
tests/cases/fourslash/renameForDefaultExport05.ts
Normal file
15
tests/cases/fourslash/renameForDefaultExport05.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
// @Filename: foo.ts
|
||||
////export default class DefaultExportedClass {
|
||||
////}
|
||||
/////*
|
||||
//// * Commenting DefaultExportedClass
|
||||
//// */
|
||||
////
|
||||
////var x: /**/[|DefaultExportedClass|];
|
||||
////
|
||||
////var y = new DefaultExportedClass;
|
||||
|
||||
goTo.marker();
|
||||
verify.renameInfoSucceeded("DefaultExportedClass", '"tests/cases/fourslash/foo".DefaultExportedClass');
|
||||
15
tests/cases/fourslash/renameForDefaultExport06.ts
Normal file
15
tests/cases/fourslash/renameForDefaultExport06.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
// @Filename: foo.ts
|
||||
////export default class DefaultExportedClass {
|
||||
////}
|
||||
/////*
|
||||
//// * Commenting DefaultExportedClass
|
||||
//// */
|
||||
////
|
||||
////var x: DefaultExportedClass;
|
||||
////
|
||||
////var y = new /**/[|DefaultExportedClass|];
|
||||
|
||||
goTo.marker();
|
||||
verify.renameInfoSucceeded("DefaultExportedClass", '"tests/cases/fourslash/foo".DefaultExportedClass');
|
||||
16
tests/cases/fourslash/renameForDefaultExport07.ts
Normal file
16
tests/cases/fourslash/renameForDefaultExport07.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
// @Filename: foo.ts
|
||||
////export default function /**/[|DefaultExportedFunction|]() {
|
||||
//// return DefaultExportedFunction
|
||||
////}
|
||||
/////**
|
||||
//// * Commenting DefaultExportedFunction
|
||||
//// */
|
||||
////
|
||||
////var x: typeof DefaultExportedFunction;
|
||||
////
|
||||
////var y = DefaultExportedFunction();
|
||||
|
||||
goTo.marker();
|
||||
verify.renameInfoSucceeded("DefaultExportedFunction", '"tests/cases/fourslash/foo".DefaultExportedFunction');
|
||||
16
tests/cases/fourslash/renameForDefaultExport08.ts
Normal file
16
tests/cases/fourslash/renameForDefaultExport08.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
// @Filename: foo.ts
|
||||
////export default function DefaultExportedFunction() {
|
||||
//// return /**/[|DefaultExportedFunction|]
|
||||
////}
|
||||
/////**
|
||||
//// * Commenting DefaultExportedFunction
|
||||
//// */
|
||||
////
|
||||
////var x: typeof DefaultExportedFunction;
|
||||
////
|
||||
////var y = DefaultExportedFunction();
|
||||
|
||||
goTo.marker();
|
||||
verify.renameInfoSucceeded("DefaultExportedFunction", '"tests/cases/fourslash/foo".DefaultExportedFunction');
|
||||
22
tests/cases/fourslash/renameForDefaultExport09.ts
Normal file
22
tests/cases/fourslash/renameForDefaultExport09.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
// @Filename: foo.ts
|
||||
////function /**/[|f|]() {
|
||||
//// return 100;
|
||||
////}
|
||||
////
|
||||
////export default f;
|
||||
////
|
||||
////var x: typeof f;
|
||||
////
|
||||
////var y = f();
|
||||
////
|
||||
/////**
|
||||
//// * Commenting f
|
||||
//// */
|
||||
////namespace f {
|
||||
//// var local = 100;
|
||||
////}
|
||||
|
||||
goTo.marker();
|
||||
verify.renameInfoSucceeded("f", "f");
|
||||
@@ -0,0 +1,8 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////var x = function /**/[|f|](g: any, h: any) {
|
||||
//// f(f, g);
|
||||
////}
|
||||
|
||||
goTo.marker();
|
||||
verify.renameInfoSucceeded("f");
|
||||
34
tests/cases/fourslash/renameLocationsForClassExpression01.ts
Normal file
34
tests/cases/fourslash/renameLocationsForClassExpression01.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////class Foo {
|
||||
////}
|
||||
////
|
||||
////var x = class /**/Foo {
|
||||
//// doIt() {
|
||||
//// return Foo;
|
||||
//// }
|
||||
////
|
||||
//// static doItStatically() {
|
||||
//// return Foo;
|
||||
//// }
|
||||
////}
|
||||
////
|
||||
////var y = class {
|
||||
//// getSomeName() {
|
||||
//// return Foo
|
||||
//// }
|
||||
////}
|
||||
|
||||
|
||||
// TODO (yuit): Fix up this test when class expressions are supported.
|
||||
// Just uncomment the below, remove the marker, and add the
|
||||
// appropriate ranges in the test itself.
|
||||
goTo.marker();
|
||||
verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false);
|
||||
|
||||
////let ranges = test.ranges()
|
||||
////for (let range of ranges) {
|
||||
//// goTo.position(range.start);
|
||||
////
|
||||
//// verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false);
|
||||
////}
|
||||
@@ -0,0 +1,12 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////var x = function [|f|](g: any, h: any) {
|
||||
//// [|f|]([|f|], g);
|
||||
////}
|
||||
|
||||
let ranges = test.ranges()
|
||||
for (let range of ranges) {
|
||||
goTo.position(range.start);
|
||||
|
||||
verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////function f() {
|
||||
////
|
||||
////}
|
||||
////var x = function [|f|](g: any, h: any) {
|
||||
////
|
||||
//// let helper = function f(): any { f(); }
|
||||
////
|
||||
//// let foo = () => [|f|]([|f|], g);
|
||||
////}
|
||||
|
||||
let ranges = test.ranges()
|
||||
for (let range of ranges) {
|
||||
goTo.position(range.start);
|
||||
|
||||
verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false);
|
||||
}
|
||||
Reference in New Issue
Block a user