Skip to content

Commit

Permalink
fix: add MemberExpression check
Browse files Browse the repository at this point in the history
PR-URL: #5046
Closes: #5045
Reviewed-by: Athan Reines <[email protected]>
  • Loading branch information
Vinit-Pandit authored Feb 4, 2025
1 parent 367ec2c commit 079b5ac
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/node_modules/@stdlib/repl/lib/eager_evaluator.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,17 @@ function traverse( node ) {
if ( !node ) {
return false;
}
if ( node.type === 'Literal' || node.type === 'Identifier' || node.type === 'MemberExpression' ) {
if ( node.type === 'Literal' || node.type === 'Identifier' ) {
return true;
}
if ( node.type === 'BinaryExpression' ) {
if ( traverse( node.left ) && traverse( node.right ) ) {
return true;
}
} else if ( node.type === 'MemberExpression' ) {
if ( traverse( node.object ) ) {
return true;
}
} else if ( node.type === 'ExpressionStatement' ) {
if ( traverse( node.expression ) ) {
return true;
Expand Down

1 comment on commit 079b5ac

@stdlib-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage Report

Package Statements Branches Functions Lines
repl $\color{red}12134/15015$
$\color{green}+80.81\%$
$\color{red}717/962$
$\color{green}+74.53\%$
$\color{red}161/281$
$\color{green}+57.30\%$
$\color{red}12134/15015$
$\color{green}+80.81\%$

The above coverage report was generated for the changes in this push.

Please sign in to comment.