Skip to content

Commit 82ce7d9

Browse files
DavidMina96Ali Abdelfattah
andauthored
[INSD-7130] Change eval to Function for expression evaluation (#705)
* Change eval to Function for expression evaluation This change was needed for setRequestFilterExpression API to work with Hermes enabled as Hermes doesn't support eval. * Update CHANGELOG.md * Use let instead of var Co-authored-by: Ali Abdelfattah <[email protected]>
1 parent 3ce3a0e commit 82ce7d9

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
* Adds the ability to opt out of iOS source maps auto upload through the INSTABUG_SOURCEMAPS_UPLOAD_DISABLE env variable
44
* Adds dynamic entry file support through the INSTABUG_ENTRY_FILE env variable
5+
* Fixes an issue with setRequestFilterExpression API not working with Hermes
56
* Fixes an issue with swipe invocation event not working on Android
67
* Breaking: Removes the deprecated APIs. For the full list, check PR #703
78

modules/NetworkLogger.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ export default {
2121
if (isEnabled) {
2222
xhr.enableInterception();
2323
xhr.setOnDoneCallback(network => {
24-
if (!eval(_requestFilterExpression)) {
24+
let predicate = Function('network', 'return ' + _requestFilterExpression);
25+
if (!predicate(network)) {
2526
if (_networkDataObfuscationHandlerSet) {
2627
IBGEventEmitter.emit(
2728
InstabugConstants.NETWORK_DATA_OBFUSCATION_HANDLER_EVENT,

0 commit comments

Comments
 (0)