mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 21:53:42 -06:00
more baselines. revert unintentional change to harness.ts.
This commit is contained in:
parent
e6d1e39fb7
commit
4db419d93c
@ -8738,20 +8738,6 @@ module ts {
|
||||
|
||||
// Language service support
|
||||
|
||||
function getNodeAtPosition(sourceFile: SourceFile, position: number): Node {
|
||||
function findChildAtPosition(parent: Node): Node {
|
||||
var child = forEachChild(parent, node => {
|
||||
if (position >= node.pos && position <= node.end && position >= getTokenPosOfNode(node)) {
|
||||
return findChildAtPosition(node);
|
||||
}
|
||||
});
|
||||
return child || parent;
|
||||
}
|
||||
if (position < sourceFile.pos) position = sourceFile.pos;
|
||||
if (position > sourceFile.end) position = sourceFile.end;
|
||||
return findChildAtPosition(sourceFile);
|
||||
}
|
||||
|
||||
function isInsideWithStatementBody(node: Node): boolean {
|
||||
if (node) {
|
||||
while (node.parent) {
|
||||
|
||||
@ -27,7 +27,6 @@ var _chai: typeof chai = require('chai');
|
||||
var assert: typeof _chai.assert = _chai.assert;
|
||||
declare var __dirname: any; // Node-specific
|
||||
var global = <any>Function("return this").call(null);
|
||||
var typescript = require('./typescriptServices');
|
||||
|
||||
module Utils {
|
||||
var global = <any>Function("return this").call(null);
|
||||
@ -1390,4 +1389,7 @@ module Harness {
|
||||
}
|
||||
|
||||
if (Error) (<any>Error).stackTraceLimit = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: not sure why Utils.evalFile isn't working with this, eventually will concat it like old compiler instead of eval
|
||||
eval(Harness.tcServicesFile);
|
||||
|
||||
@ -5379,19 +5379,6 @@ module ts {
|
||||
return new RegExp(regExpString, "gim");
|
||||
}
|
||||
|
||||
function getContainingComment(comments: CommentRange[], position: number): CommentRange {
|
||||
if (comments) {
|
||||
for (var i = 0, n = comments.length; i < n; i++) {
|
||||
var comment = comments[i];
|
||||
if (comment.pos <= position && position < comment.end) {
|
||||
return comment;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function isLetterOrDigit(char: number): boolean {
|
||||
return (char >= CharacterCodes.a && char <= CharacterCodes.z) ||
|
||||
(char >= CharacterCodes.A && char <= CharacterCodes.Z) ||
|
||||
|
||||
@ -104,21 +104,6 @@ module ts {
|
||||
return syntaxList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Includes the start position of each child, but excludes the end.
|
||||
*/
|
||||
export function findListItemIndexContainingPosition(list: Node, position: number): number {
|
||||
Debug.assert(list.kind === SyntaxKind.SyntaxList);
|
||||
var children = list.getChildren();
|
||||
for (var i = 0; i < children.length; i++) {
|
||||
if (children[i].pos <= position && children[i].end > position) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Gets the token whose text has range [start, end) and
|
||||
* position >= start and (position < end or (position === end && token is keyword or identifier))
|
||||
*/
|
||||
|
||||
@ -0,0 +1,8 @@
|
||||
tests/cases/compiler/typeParameterInConstraint1.ts(1,12): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
||||
|
||||
|
||||
==== tests/cases/compiler/typeParameterInConstraint1.ts (1 errors) ====
|
||||
class C<T, U extends T> {
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
||||
}
|
||||
10
tests/baselines/reference/typeParameterInConstraint1.js
Normal file
10
tests/baselines/reference/typeParameterInConstraint1.js
Normal file
@ -0,0 +1,10 @@
|
||||
//// [typeParameterInConstraint1.ts]
|
||||
class C<T, U extends T> {
|
||||
}
|
||||
|
||||
//// [typeParameterInConstraint1.js]
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
return C;
|
||||
})();
|
||||
2
tests/cases/compiler/typeParameterInConstraint1.ts
Normal file
2
tests/cases/compiler/typeParameterInConstraint1.ts
Normal file
@ -0,0 +1,2 @@
|
||||
class C<T, U extends T> {
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user