Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfda9974

Browse files
committed
Merge branch 'master' into inlineSourceMaps
2 parents5d78dd2 +baac6d8 commitfda9974

File tree

41 files changed

+739
-293
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+739
-293
lines changed

‎src/compiler/checker.ts‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ module ts {
77

88
/* @internal */ export let checkTime = 0;
99

10+
/* @internal */
11+
export function getSymbolId(symbol: Symbol): number {
12+
if (!symbol.id) {
13+
symbol.id = nextSymbolId++;
14+
}
15+
16+
return symbol.id;
17+
}
18+
1019
export function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker {
1120
let Symbol = objectAllocator.getSymbolConstructor();
1221
let Type = objectAllocator.getTypeConstructor();
@@ -250,8 +259,8 @@ module ts {
250259

251260
function getSymbolLinks(symbol: Symbol): SymbolLinks {
252261
if (symbol.flags & SymbolFlags.Transient) return <TransientSymbol>symbol;
253-
if (!symbol.id) symbol.id = nextSymbolId++;
254-
return symbolLinks[symbol.id] || (symbolLinks[symbol.id] = {});
262+
var id = getSymbolId(symbol);
263+
return symbolLinks[id] || (symbolLinks[id] = {});
255264
}
256265

257266
function getNodeLinks(node: Node): NodeLinks {

‎src/compiler/program.ts‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,22 @@ module ts {
1010
/** The version of the TypeScript compiler release */
1111
exportletversion="1.5.0.0";
1212

13+
exportfunctionfindConfigFile(searchPath:string):string{
14+
varfileName="tsconfig.json";
15+
while(true){
16+
if(sys.fileExists(fileName)){
17+
returnfileName;
18+
}
19+
varparentPath=getDirectoryPath(searchPath);
20+
if(parentPath===searchPath){
21+
break;
22+
}
23+
searchPath=parentPath;
24+
fileName="../"+fileName;
25+
}
26+
returnundefined;
27+
}
28+
1329
exportfunctioncreateCompilerHost(options:CompilerOptions,setParentNodes?:boolean):CompilerHost{
1430
letcurrentDirectory:string;
1531
letexistingDirectories:Map<boolean>={};

‎src/compiler/scanner.ts‎

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,13 +318,38 @@ module ts {
318318
lethasOwnProperty=Object.prototype.hasOwnProperty;
319319

320320
exportfunctionisWhiteSpace(ch:number):boolean{
321-
returnch===CharacterCodes.space||ch===CharacterCodes.tab||ch===CharacterCodes.verticalTab||ch===CharacterCodes.formFeed||
322-
ch===CharacterCodes.nonBreakingSpace||ch===CharacterCodes.ogham||ch>=CharacterCodes.enQuad&&ch<=CharacterCodes.zeroWidthSpace||
323-
ch===CharacterCodes.narrowNoBreakSpace||ch===CharacterCodes.mathematicalSpace||ch===CharacterCodes.ideographicSpace||ch===CharacterCodes.byteOrderMark;
321+
// Note: nextLine is in the Zs space, and should be considered to be a whitespace.
322+
// It is explicitly not a line-break as it isn't in the exact set specified by EcmaScript.
323+
returnch===CharacterCodes.space||
324+
ch===CharacterCodes.tab||
325+
ch===CharacterCodes.verticalTab||
326+
ch===CharacterCodes.formFeed||
327+
ch===CharacterCodes.nonBreakingSpace||
328+
ch===CharacterCodes.nextLine||
329+
ch===CharacterCodes.ogham||
330+
ch>=CharacterCodes.enQuad&&ch<=CharacterCodes.zeroWidthSpace||
331+
ch===CharacterCodes.narrowNoBreakSpace||
332+
ch===CharacterCodes.mathematicalSpace||
333+
ch===CharacterCodes.ideographicSpace||
334+
ch===CharacterCodes.byteOrderMark;
324335
}
325336

326337
exportfunctionisLineBreak(ch:number):boolean{
327-
returnch===CharacterCodes.lineFeed||ch===CharacterCodes.carriageReturn||ch===CharacterCodes.lineSeparator||ch===CharacterCodes.paragraphSeparator||ch===CharacterCodes.nextLine;
338+
// ES5 7.3:
339+
// The ECMAScript line terminator characters are listed in Table 3.
340+
// Table 3 — Line Terminator Characters
341+
// Code Unit Value Name Formal Name
342+
// \u000A Line Feed <LF>
343+
// \u000D Carriage Return <CR>
344+
// \u2028 Line separator <LS>
345+
// \u2029 Paragraph separator <PS>
346+
// Only the characters in Table 3 are treated as line terminators. Other new line or line
347+
// breaking characters are treated as white space but not as line terminators.
348+
349+
returnch===CharacterCodes.lineFeed||
350+
ch===CharacterCodes.carriageReturn||
351+
ch===CharacterCodes.lineSeparator||
352+
ch===CharacterCodes.paragraphSeparator;
328353
}
329354

330355
functionisDigit(ch:number):boolean{

‎src/compiler/tsc.ts‎

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -132,23 +132,6 @@ module ts {
132132
returntypeofJSON==="object"&&typeofJSON.parse==="function";
133133
}
134134

135-
functionfindConfigFile():string{
136-
varsearchPath=normalizePath(sys.getCurrentDirectory());
137-
varfileName="tsconfig.json";
138-
while(true){
139-
if(sys.fileExists(fileName)){
140-
returnfileName;
141-
}
142-
varparentPath=getDirectoryPath(searchPath);
143-
if(parentPath===searchPath){
144-
break;
145-
}
146-
searchPath=parentPath;
147-
fileName="../"+fileName;
148-
}
149-
returnundefined;
150-
}
151-
152135
exportfunctionexecuteCommandLine(args:string[]):void{
153136
varcommandLine=parseCommandLine(args);
154137
varconfigFileName:string;// Configuration file name (if any)
@@ -198,7 +181,8 @@ module ts {
198181
}
199182
}
200183
elseif(commandLine.fileNames.length===0&&isJSONSupported()){
201-
configFileName=findConfigFile();
184+
varsearchPath=normalizePath(sys.getCurrentDirectory());
185+
configFileName=findConfigFile(searchPath);
202186
}
203187

204188
if(commandLine.fileNames.length===0&&!configFileName){

‎src/harness/harnessLanguageService.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,9 @@ module Harness.LanguageService {
330330
getReferencesAtPosition(fileName:string,position:number):ts.ReferenceEntry[]{
331331
returnunwrapJSONCallResult(this.shim.getReferencesAtPosition(fileName,position));
332332
}
333+
findReferences(fileName:string,position:number):ts.ReferencedSymbol[]{
334+
returnunwrapJSONCallResult(this.shim.findReferences(fileName,position));
335+
}
333336
getOccurrencesAtPosition(fileName:string,position:number):ts.ReferenceEntry[]{
334337
returnunwrapJSONCallResult(this.shim.getOccurrencesAtPosition(fileName,position));
335338
}

‎src/server/client.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,11 @@ module ts.server {
300300
});
301301
}
302302

303+
findReferences(fileName:string,position:number):ReferencedSymbol[]{
304+
// Not yet implemented.
305+
return[];
306+
}
307+
303308
getReferencesAtPosition(fileName:string,position:number):ReferenceEntry[]{
304309
varlineOffset=this.positionToOneBasedLineOffset(fileName,position);
305310
varargs:protocol.FileLocationRequestArgs={

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp