File tree Expand file tree Collapse file tree
packages/javascript-kernel/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ import type { IMimeBundle } from '@jupyterlab/nbformat';
1010
1111export { IDisplayData , IDisplayCallbacks , DisplayHelper } from './display' ;
1212
13+ /** Matches the word "eval" in a stack frame (user eval code). */
14+ const RE_EVAL = / \b e v a l \b / ;
15+
1316/**
1417 * Configuration for magic imports.
1518 */
@@ -793,19 +796,10 @@ export class JavaScriptExecutor {
793796 break ;
794797 }
795798
796- // Keep eval frames from user code.
797- if ( / \b e v a l \b / . test ( trimmed ) || trimmed . includes ( '<anonymous>' ) ) {
799+ // Only keep lines that reference user eval code.
800+ if ( RE_EVAL . test ( trimmed ) || trimmed . includes ( '<anonymous>' ) ) {
798801 userFrames . push ( line ) ;
799- continue ;
800- }
801-
802- // Drop stack frames that point to bundled code.
803- if ( / ^ \s * a t \s + / . test ( trimmed ) || / ^ [ ^ @ ] * @ \S + : \d + : \d + $ / . test ( trimmed ) ) {
804- continue ;
805802 }
806-
807- // Keep any other lines (may be useful context).
808- userFrames . push ( line ) ;
809803 }
810804
811805 if ( userFrames . length > 0 ) {
You can’t perform that action at this time.
0 commit comments