mirror of
https://github.com/github/semantic.git
synced 2024-12-27 17:05:33 +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")
|
||||
foo.greet()
|
||||
var foo = new Adder(5)
|
||||
foo.add()
|
||||
|
14
test/fixtures/typescript/analysis/class2.ts
vendored
14
test/fixtures/typescript/analysis/class2.ts
vendored
@ -1,11 +1,11 @@
|
||||
class Greeter {
|
||||
greeting: string;
|
||||
constructor(message: string) {
|
||||
this.greeting = message;
|
||||
class Adder {
|
||||
summand: number;
|
||||
constructor(summand: number) {
|
||||
this.summand = summand;
|
||||
}
|
||||
greet() {
|
||||
return "Hello, " + this.greeting;
|
||||
add() {
|
||||
return 4 + this.summand;
|
||||
}
|
||||
}
|
||||
|
||||
export { Greeter }
|
||||
export { Adder }
|
||||
|
Loading…
Reference in New Issue
Block a user