Skip to content

Commit c39da05

Browse files
committed
Add more cases to userdefinedservice
1 parent 6514387 commit c39da05

File tree

6 files changed

+37
-10
lines changed

6 files changed

+37
-10
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const cds = require("@sap/cds");
2+
3+
class Service1 extends cds.ApplicationService { // ES6ApplicationServiceDefinition
4+
init() {
5+
return super.init()
6+
}
7+
}
8+
9+
module.exports = Service1
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
const cds = require("@sap/cds");
22

3-
class BooksService extends cds.ApplicationService {
4-
init() {
5-
return super.init()
6-
}
7-
}
8-
module.exports = BooksService
9-
103
module.exports = class LogService extends cds.Service {
114
init() {
125
return super.init()
136
}
14-
}
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const cds = require("@sap/cds");
2+
3+
module.exports = cds.service.impl(function () { // ImplMethodCallApplicationServiceDefinition
4+
this.on("SomeEvent1", (req) => {
5+
/* ... */
6+
});
7+
});
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const cds = require("@sap/cds");
2+
3+
module.exports = cds.service.impl((srv) => { // ImplMethodCallApplicationServiceDefinition
4+
this.on("SomeEvent1", (req) => {
5+
/* ... */
6+
});
7+
});
8+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const cds = require("@sap/cds");
2+
3+
module.exports = (srv) => { // ExportedClosureApplicationServiceDefinition
4+
srv.on("SomeEvent1", (req) => {
5+
/* ... */
6+
});
7+
};
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
| userdefinedservice.js:3:1:7:1 | class B ... )\\n }\\n} |
2-
| userdefinedservice.js:10:18:14:1 | class L ... )\\n }\\n} |
1+
| service1.js:3:1:7:1 | class S ... )\\n }\\n} |
2+
| service2.js:3:18:7:1 | class L ... )\\n }\\n} |
3+
| service3.js:3:18:7:2 | cds.ser ... });\\n}) |
4+
| service4.js:3:18:7:2 | cds.ser ... });\\n}) |
5+
| service5.js:3:18:7:1 | (srv) = ... });\\n} |

0 commit comments

Comments
 (0)