File tree Expand file tree Collapse file tree 5 files changed +51
-1
lines changed Expand file tree Collapse file tree 5 files changed +51
-1
lines changed Original file line number Diff line number Diff line change @@ -226,7 +226,7 @@ impl Instrumentation {
226
226
self . insert_tracing ( body) ;
227
227
}
228
228
}
229
- false
229
+ true
230
230
}
231
231
232
232
pub fn visit_mut_var_decl ( & mut self , node : & mut VarDecl ) -> bool {
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ mod index_cjs;
17
17
mod injection_failure;
18
18
mod multiple_class_method_cjs;
19
19
mod multiple_load_cjs;
20
+ mod nested_functions;
20
21
mod object_method_cjs;
21
22
mod polyfill_cjs;
22
23
mod polyfill_mjs;
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
3
+ * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc.
4
+ **/
5
+
6
+ function fastify ( ) {
7
+ const fastify = {
8
+ addHook
9
+ }
10
+
11
+ function addHook ( ) {
12
+ return 'Hook added' ;
13
+ }
14
+
15
+ return fastify
16
+ }
17
+
18
+ module . exports = fastify ;
Original file line number Diff line number Diff line change
1
+ use crate :: common:: * ;
2
+ use orchestrion_js:: * ;
3
+
4
+ #[ test]
5
+ fn nested_fn ( ) {
6
+ transpile_and_test (
7
+ file ! ( ) ,
8
+ false ,
9
+ Config :: new_single ( InstrumentationConfig :: new (
10
+ "nested_fn" ,
11
+ test_module_matcher ( ) ,
12
+ FunctionQuery :: function_declaration ( "addHook" , FunctionKind :: Sync ) ,
13
+ ) ) ,
14
+ ) ;
15
+ }
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
3
+ * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc.
4
+ **/
5
+ const fastify = require ( './instrumented.js' ) ;
6
+ const { assert, getContext } = require ( '../common/preamble.js' ) ;
7
+ const context = getContext ( 'orchestrion:undici:nested_fn' ) ;
8
+ ( async ( ) => {
9
+ const f = fastify ( )
10
+ const result = f . addHook ( )
11
+ assert . strictEqual ( result , 'Hook added' ) ;
12
+ assert . deepStrictEqual ( context , {
13
+ start : true ,
14
+ end : true ,
15
+ } ) ;
16
+ } ) ( ) ;
You can’t perform that action at this time.
0 commit comments