mirror of
https://github.com/github/semantic.git
synced 2024-12-29 01:42:43 +03:00
Update Greeter example to Adder
This commit is contained in:
parent
ea4c9462bd
commit
75ac094409
6
test/fixtures/typescript/analysis/class1.ts
vendored
6
test/fixtures/typescript/analysis/class1.ts
vendored
@ -1,4 +1,4 @@
|
|||||||
import { Greeter } from "./class2"
|
import { Adder } from "./class2"
|
||||||
|
|
||||||
const foo = new Greeter("world")
|
var foo = new Adder(5)
|
||||||
foo.greet()
|
foo.add()
|
||||||
|
14
test/fixtures/typescript/analysis/class2.ts
vendored
14
test/fixtures/typescript/analysis/class2.ts
vendored
@ -1,11 +1,11 @@
|
|||||||
class Greeter {
|
class Adder {
|
||||||
greeting: string;
|
summand: number;
|
||||||
constructor(message: string) {
|
constructor(summand: number) {
|
||||||
this.greeting = message;
|
this.summand = summand;
|
||||||
}
|
}
|
||||||
greet() {
|
add() {
|
||||||
return "Hello, " + this.greeting;
|
return 4 + this.summand;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export { Greeter }
|
export { Adder }
|
||||||
|
Loading…
Reference in New Issue
Block a user