Skip to content

Fix missing parentheses in toString method call#129

Merged
albertyw merged 1 commit intouber:masterfrom
Nepomuk5665:fix-tostring-method-call
Jan 28, 2026
Merged

Fix missing parentheses in toString method call#129
albertyw merged 1 commit intouber:masterfrom
Nepomuk5665:fix-tostring-method-call

Conversation

@Nepomuk5665
Copy link
Copy Markdown
Contributor

Summary

  • Fix bug where error message for invalid operator type displayed the toString function reference instead of the actual valid operator types

Problem

In src/alert/condition.ts, the withOperator method was using types.toString (function reference) instead of types.toString() (function call) when constructing the error message. This resulted in unhelpful error messages:

Before:

Operator must be one of [function toString() { [native code] }]

After:

Operator must be one of [and,or]

Changes

  • Added missing parentheses to toString method call on line 65 of src/alert/condition.ts

Testing

  • All existing tests pass
  • The error message now correctly displays the valid operator types

The error message for invalid operator type was displaying the toString
function reference instead of the actual valid operator types. This was
caused by missing parentheses on the toString method call.

Before: 'Operator must be one of [function toString() { [native code] }]'
After: 'Operator must be one of [and,or]'
@albertyw albertyw merged commit 50b13b8 into uber:master Jan 28, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants