Merge branch 'master' into semanticBindingPropNames

This commit is contained in:
Daniel Rosenwasser
2015-06-29 12:39:01 -04:00
68 changed files with 643 additions and 173 deletions

View File

@@ -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.
~

View File

@@ -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();

View File

@@ -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();

View 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);
}
}

View 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);
}
}

View 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);
}
}

View 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);
}

View 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);
}

View 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);
}

View 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);

View 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);

View 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);
}
}

View 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() { }")

View 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);
}

View 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);
}

View 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);
}

View 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');

View 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');

View 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');

View 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');

View 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');

View 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");

View File

@@ -0,0 +1,8 @@
/// <reference path='fourslash.ts'/>
////var x = function /**/[|f|](g: any, h: any) {
//// f(f, g);
////}
goTo.marker();
verify.renameInfoSucceeded("f");

View 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);
////}

View File

@@ -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);
}

View File

@@ -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);
}