JS: Add a test case with fluent flow

This commit is contained in:
Asger F
2024-04-05 11:30:35 +02:00
parent c55e03c588
commit 348c95ebe1
3 changed files with 33 additions and 0 deletions

View File

@@ -1,7 +1,19 @@
typeModel
| (reexport).func | reexport | Member[func] |
| (return-this).FluentInterface | return-this | Member[FluentInterface] |
| (return-this).FluentInterface.prototype | (return-this).FluentInterface | Instance |
| (return-this).FluentInterface.prototype | (return-this).FluentInterface.prototype.bar | ReturnValue |
| (return-this).FluentInterface.prototype | (return-this).FluentInterface.prototype.baz | ReturnValue |
| (return-this).FluentInterface.prototype.bar | (return-this).FluentInterface.prototype | Member[bar] |
| (return-this).FluentInterface.prototype.baz | (return-this).FluentInterface.prototype | Member[baz] |
| (return-this).FluentInterface.prototype.foo | (return-this).FluentInterface.prototype | Member[foo] |
| (return-this).FluentInterface.prototype.notFluent | (return-this).FluentInterface.prototype | Member[notFluent] |
| (return-this).FluentInterface.prototype.notFluent2 | (return-this).FluentInterface.prototype | Member[notFluent2] |
| upstream-lib | (reexport).func | ReturnValue |
| upstream-lib | reexport | Member[lib] |
| upstream-lib.XYZ | reexport | Member[x].Member[y].Member[z] |
| upstream-lib.XYZ | reexport | Member[xy].Member[z] |
summaryModel
| (return-this).FluentInterface.prototype | | | Member[bar].ReturnValue | type |
| (return-this).FluentInterface.prototype | | | Member[baz].ReturnValue | type |
| (return-this).FluentInterface.prototype | | | Member[foo].ReturnValue | type |

View File

@@ -0,0 +1,4 @@
{
"name": "return-this",
"main": "return-this.js"
}

View File

@@ -0,0 +1,17 @@
export class FluentInterface {
foo() {
return this;
}
bar() {
return this.foo();
}
baz() {
return this.foo().bar().bar().foo();
}
notFluent() {
this.foo();
}
notFluent2() {
return this.notFluent2();
}
}