100 lines
4.5 KiB
Text
100 lines
4.5 KiB
Text
=== tests/cases/compiler/sourceMapValidationClasses.ts ===
|
|
module Foo.Bar {
|
|
>Foo : Symbol(Foo, Decl(sourceMapValidationClasses.ts, 0, 0))
|
|
>Bar : Symbol(Bar, Decl(sourceMapValidationClasses.ts, 0, 11))
|
|
|
|
"use strict";
|
|
|
|
class Greeter {
|
|
>Greeter : Symbol(Greeter, Decl(sourceMapValidationClasses.ts, 1, 17))
|
|
|
|
constructor(public greeting: string) {
|
|
>greeting : Symbol(greeting, Decl(sourceMapValidationClasses.ts, 4, 20))
|
|
}
|
|
|
|
greet() {
|
|
>greet : Symbol(greet, Decl(sourceMapValidationClasses.ts, 5, 9))
|
|
|
|
return "<h1>" + this.greeting + "</h1>";
|
|
>this.greeting : Symbol(greeting, Decl(sourceMapValidationClasses.ts, 4, 20))
|
|
>this : Symbol(Greeter, Decl(sourceMapValidationClasses.ts, 1, 17))
|
|
>greeting : Symbol(greeting, Decl(sourceMapValidationClasses.ts, 4, 20))
|
|
}
|
|
}
|
|
|
|
|
|
function foo(greeting: string): Greeter {
|
|
>foo : Symbol(foo, Decl(sourceMapValidationClasses.ts, 10, 5))
|
|
>greeting : Symbol(greeting, Decl(sourceMapValidationClasses.ts, 13, 17))
|
|
>Greeter : Symbol(Greeter, Decl(sourceMapValidationClasses.ts, 1, 17))
|
|
|
|
return new Greeter(greeting);
|
|
>Greeter : Symbol(Greeter, Decl(sourceMapValidationClasses.ts, 1, 17))
|
|
>greeting : Symbol(greeting, Decl(sourceMapValidationClasses.ts, 13, 17))
|
|
}
|
|
|
|
var greeter = new Greeter("Hello, world!");
|
|
>greeter : Symbol(greeter, Decl(sourceMapValidationClasses.ts, 17, 7))
|
|
>Greeter : Symbol(Greeter, Decl(sourceMapValidationClasses.ts, 1, 17))
|
|
|
|
var str = greeter.greet();
|
|
>str : Symbol(str, Decl(sourceMapValidationClasses.ts, 18, 7))
|
|
>greeter.greet : Symbol(Greeter.greet, Decl(sourceMapValidationClasses.ts, 5, 9))
|
|
>greeter : Symbol(greeter, Decl(sourceMapValidationClasses.ts, 17, 7))
|
|
>greet : Symbol(Greeter.greet, Decl(sourceMapValidationClasses.ts, 5, 9))
|
|
|
|
function foo2(greeting: string, ...restGreetings /* more greeting */: string[]) {
|
|
>foo2 : Symbol(foo2, Decl(sourceMapValidationClasses.ts, 18, 30))
|
|
>greeting : Symbol(greeting, Decl(sourceMapValidationClasses.ts, 20, 18))
|
|
>restGreetings : Symbol(restGreetings, Decl(sourceMapValidationClasses.ts, 20, 35))
|
|
|
|
var greeters: Greeter[] = []; /* inline block comment */
|
|
>greeters : Symbol(greeters, Decl(sourceMapValidationClasses.ts, 21, 11))
|
|
>Greeter : Symbol(Greeter, Decl(sourceMapValidationClasses.ts, 1, 17))
|
|
|
|
greeters[0] = new Greeter(greeting);
|
|
>greeters : Symbol(greeters, Decl(sourceMapValidationClasses.ts, 21, 11))
|
|
>Greeter : Symbol(Greeter, Decl(sourceMapValidationClasses.ts, 1, 17))
|
|
>greeting : Symbol(greeting, Decl(sourceMapValidationClasses.ts, 20, 18))
|
|
|
|
for (var i = 0; i < restGreetings.length; i++) {
|
|
>i : Symbol(i, Decl(sourceMapValidationClasses.ts, 23, 16))
|
|
>i : Symbol(i, Decl(sourceMapValidationClasses.ts, 23, 16))
|
|
>restGreetings.length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20))
|
|
>restGreetings : Symbol(restGreetings, Decl(sourceMapValidationClasses.ts, 20, 35))
|
|
>length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20))
|
|
>i : Symbol(i, Decl(sourceMapValidationClasses.ts, 23, 16))
|
|
|
|
greeters.push(new Greeter(restGreetings[i]));
|
|
>greeters.push : Symbol(Array.push, Decl(lib.d.ts, 1016, 29))
|
|
>greeters : Symbol(greeters, Decl(sourceMapValidationClasses.ts, 21, 11))
|
|
>push : Symbol(Array.push, Decl(lib.d.ts, 1016, 29))
|
|
>Greeter : Symbol(Greeter, Decl(sourceMapValidationClasses.ts, 1, 17))
|
|
>restGreetings : Symbol(restGreetings, Decl(sourceMapValidationClasses.ts, 20, 35))
|
|
>i : Symbol(i, Decl(sourceMapValidationClasses.ts, 23, 16))
|
|
}
|
|
|
|
return greeters;
|
|
>greeters : Symbol(greeters, Decl(sourceMapValidationClasses.ts, 21, 11))
|
|
}
|
|
|
|
var b = foo2("Hello", "World", "!");
|
|
>b : Symbol(b, Decl(sourceMapValidationClasses.ts, 30, 7))
|
|
>foo2 : Symbol(foo2, Decl(sourceMapValidationClasses.ts, 18, 30))
|
|
|
|
// This is simple signle line comment
|
|
for (var j = 0; j < b.length; j++) {
|
|
>j : Symbol(j, Decl(sourceMapValidationClasses.ts, 32, 12))
|
|
>j : Symbol(j, Decl(sourceMapValidationClasses.ts, 32, 12))
|
|
>b.length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20))
|
|
>b : Symbol(b, Decl(sourceMapValidationClasses.ts, 30, 7))
|
|
>length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20))
|
|
>j : Symbol(j, Decl(sourceMapValidationClasses.ts, 32, 12))
|
|
|
|
b[j].greet();
|
|
>b[j].greet : Symbol(Greeter.greet, Decl(sourceMapValidationClasses.ts, 5, 9))
|
|
>b : Symbol(b, Decl(sourceMapValidationClasses.ts, 30, 7))
|
|
>j : Symbol(j, Decl(sourceMapValidationClasses.ts, 32, 12))
|
|
>greet : Symbol(Greeter.greet, Decl(sourceMapValidationClasses.ts, 5, 9))
|
|
}
|
|
}
|