@@ -1049,23 +1049,11 @@ function evaldataPrune(
1049
1049
) {
1050
1050
self . eval = new Proxy ( self . eval , {
1051
1051
apply ( target , thisArg , args ) {
1052
- let dataToEval = `${ args [ 0 ] } ` ;
1053
- const match = / ^ \s * \( \s * ( \{ .+ \} ) \s * \) \s * $ / s. exec ( dataToEval ) ;
1054
- if ( match !== null ) {
1055
- dataToEval = match [ 1 ] ;
1052
+ let data = Reflect . apply ( target , thisArg , args ) ;
1053
+ if ( typeof data === 'object' ) {
1054
+ data = objectPrune ( data , rawPrunePaths , rawNeedlePaths ) ;
1056
1055
}
1057
- let data ;
1058
- try {
1059
- data = JSON . parse ( dataToEval ) ;
1060
- if ( typeof data === 'object' ) {
1061
- let after = JSON . stringify (
1062
- objectPrune ( data , rawPrunePaths , rawNeedlePaths )
1063
- ) ;
1064
- args [ 0 ] = `(${ after } )` ;
1065
- }
1066
- } catch ( ex ) {
1067
- }
1068
- return Reflect . apply ( target , thisArg , args ) ;
1056
+ return data ;
1069
1057
}
1070
1058
} ) ;
1071
1059
}
@@ -2332,7 +2320,7 @@ function hrefSanitizer(
2332
2320
} ;
2333
2321
const extractText = ( elem , source ) => {
2334
2322
if ( / ^ \[ .* \] $ / . test ( source ) ) {
2335
- return elem . getAttribute ( source . slice ( 1 , - 1 ) . trim ( ) ) || '' ;
2323
+ source = elem . getAttribute ( source . slice ( 1 , - 1 ) . trim ( ) ) || '' ;
2336
2324
}
2337
2325
if ( source !== 'text' ) { return '' ; }
2338
2326
const text = elem . textContent
0 commit comments