File tree Expand file tree Collapse file tree 5 files changed +54
-2
lines changed Expand file tree Collapse file tree 5 files changed +54
-2
lines changed Original file line number Diff line number Diff line change 4
4
5
5
** This release is under development and information may be incomplete**
6
6
7
+ - Added code to keep the method name in internally bound functions.
8
+ PR #1466 (Slawomir Osoba)
9
+
7
10
- Added code to handle multiple out-binds with ([ DbObject] ( https://oracle.github.io/node-oracledb/doc/api.html#dbobjectclass ) ) correctly, earlier only
8
11
the first one was processed and was resulting in a crash.
9
12
([ Issue #1464 ] ( https://github.com/oracle/node-oracledb/issues/1464 ) )
Original file line number Diff line number Diff line change @@ -170,7 +170,7 @@ module.exports.checkArgCount = checkArgCount;
170
170
// is resolved or rejected and the callback invoked; otherwise, the function is
171
171
// called unchanged and a promise is returned
172
172
function callbackify ( func ) {
173
- return function ( ) {
173
+ const wrapper = function ( ) {
174
174
175
175
// if last argument is not a function, simply invoke the function as usual
176
176
// and a promise will be returned
@@ -186,6 +186,10 @@ function callbackify(func) {
186
186
} , cb ) ;
187
187
188
188
} ;
189
+ if ( func . name ) {
190
+ Object . defineProperty ( wrapper , 'name' , { value : func . name } ) ;
191
+ }
192
+ return wrapper ;
189
193
}
190
194
191
195
module . exports . callbackify = callbackify ;
Original file line number Diff line number Diff line change @@ -5299,3 +5299,7 @@ oracledb.OUT_FORMAT_OBJECT and resultSet = true
5299
5299
5300
5300
262. dbObjectOutBind.js
5301
5301
262.1 call procedure with 2 OUT binds of DbObject
5302
+
5303
+
5304
+ 264. methodName.js
5305
+ 264.1 check for methodName getConnection
Original file line number Diff line number Diff line change
1
+ /* Copyright (c) 2022, Oracle and/or its affiliates. */
2
+
3
+ /******************************************************************************
4
+ *
5
+ * You may not use the identified files except in compliance with the Apache
6
+ * License, Version 2.0 (the "License.")
7
+ *
8
+ * You may obtain a copy of the License at
9
+ * http://www.apache.org/licenses/LICENSE-2.0.
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ *
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ *
18
+ * NAME
19
+ * 264. methodName.js
20
+ *
21
+ * DESCRIPTION
22
+ * Test to verify the code to keep the method name in internally bound
23
+ * functions.
24
+ *
25
+ * Note: These tests uses additional file test/testMethodName.js which is
26
+ * spawned and the output is compared.
27
+ *
28
+ *****************************************************************************/
29
+ 'use strict' ;
30
+
31
+ const oracledb = require ( 'oracledb' ) ;
32
+ const assert = require ( 'assert' ) ;
33
+
34
+ describe ( '264. methodName.js' , ( ) => {
35
+
36
+ it ( '264.1 check for methodName getConnection' , function ( ) {
37
+ assert . equal ( oracledb . getConnection . name , 'bound getConnection' ) ;
38
+ } ) ;
39
+
40
+ } ) ;
Original file line number Diff line number Diff line change @@ -248,4 +248,5 @@ spec:
248
248
- test/tpc.js
249
249
- test/tpcResume.js
250
250
- test/connHealthy.js
251
- - test/dbObjectOutBind.js
251
+ - test/dbObjectOutBind.js
252
+ - test/methodName.js
You can’t perform that action at this time.
0 commit comments