@@ -233,9 +233,9 @@ export default class JavascriptEventWorker extends EventWorker {
233233 */
234234 lines = this . readSourceLines ( consumer , originalLocation ) ;
235235
236- const _originalContent = consumer . sourceContentFor ( originalLocation . source ) ;
236+ const originalContent = consumer . sourceContentFor ( originalLocation . source ) ;
237237
238- // functionContext = this.getFunctionContext(originalContent, originalLocation.line) ?? originalLocation.name;
238+ functionContext = this . getFunctionContext ( originalContent , originalLocation . line ) ?? originalLocation . name ;
239239 }
240240
241241 return Object . assign ( stackFrame , {
@@ -254,7 +254,7 @@ export default class JavascriptEventWorker extends EventWorker {
254254 * @param line - number of the line from the stack trace
255255 * @returns {string | null } - string of the function context or null if it could not be parsed
256256 */
257- private _getFunctionContext ( sourceCode : string , line : number ) : string | null {
257+ private getFunctionContext ( sourceCode : string , line : number ) : string | null {
258258 let functionName : string | null = null ;
259259 let className : string | null = null ;
260260 let isAsync = false ;
@@ -284,7 +284,7 @@ export default class JavascriptEventWorker extends EventWorker {
284284 ClassDeclaration ( path ) {
285285 if ( path . node . loc && path . node . loc . start . line <= line && path . node . loc . end . line >= line ) {
286286 console . log ( `class declaration: loc: ${ path . node . loc } , line: ${ line } , node.start.line: ${ path . node . loc . start . line } , node.end.line: ${ path . node . loc . end . line } ` ) ;
287-
287+
288288 className = path . node . id . name || null ;
289289 }
290290 } ,
@@ -297,7 +297,7 @@ export default class JavascriptEventWorker extends EventWorker {
297297 ClassMethod ( path ) {
298298 if ( path . node . loc && path . node . loc . start . line <= line && path . node . loc . end . line >= line ) {
299299 console . log ( `class declaration: loc: ${ path . node . loc } , line: ${ line } , node.start.line: ${ path . node . loc . start . line } , node.end.line: ${ path . node . loc . end . line } ` ) ;
300-
300+
301301 // Handle different key types
302302 if ( path . node . key . type === 'Identifier' ) {
303303 functionName = path . node . key . name ;
@@ -313,7 +313,7 @@ export default class JavascriptEventWorker extends EventWorker {
313313 FunctionDeclaration ( path ) {
314314 if ( path . node . loc && path . node . loc . start . line <= line && path . node . loc . end . line >= line ) {
315315 console . log ( `function declaration: loc: ${ path . node . loc } , line: ${ line } , node.start.line: ${ path . node . loc . start . line } , node.end.line: ${ path . node . loc . end . line } ` ) ;
316-
316+
317317 functionName = path . node . id . name || null ;
318318 isAsync = path . node . async ;
319319 }
0 commit comments