Skip to content

Commit dd3d356

Browse files
committed
Fix TypeScript 4.4's imported function behavior with 'this'
1 parent 31030c2 commit dd3d356

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
- Prevent intermingling of `queryStream()` streaming and `getRow()`/`getRows()`
2525
calls.
2626

27+
- Made an internal change for TypeScript 4.4's imported function behavior with
28+
'this' ([Issue 1408](https://github.com/oracle/node-oracledb/issues/1408)).
29+
2730
## node-oracledb v5.2.0 (7 Jun 2021)
2831

2932
- Connection pool changes:

lib/oracledb.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ class OracleDb {
100100
}
101101

102102
// extend class with promisified functions
103-
_extend() {
104-
this.getConnection = nodbUtil.callbackify(getConnection);
105-
this.createPool = nodbUtil.callbackify(createPool);
106-
this.shutdown = nodbUtil.callbackify(shutdown);
107-
this.startup = nodbUtil.callbackify(startup);
103+
_extend(_oracledb) {
104+
this.getConnection = nodbUtil.callbackify(getConnection).bind(_oracledb);
105+
this.createPool = nodbUtil.callbackify(createPool).bind(_oracledb);
106+
this.shutdown = nodbUtil.callbackify(shutdown).bind(_oracledb);
107+
this.startup = nodbUtil.callbackify(startup).bind(_oracledb);
108108
}
109109

110110
// temporary method for determining if an object is a date until

0 commit comments

Comments
 (0)