Value should not be assigned to LHS which is not a reference

  • NON_REFERENCE_LHS
  • Error
  • High
  • No tags

This rule applies when value is assigned to the left-hand side (or LHS) which is not a reference.

In this case, a ReferenceError exception is thrown.

Noncompliant Code Example

View with compliant examples side by side
if (f() = 42) { // NON_REFERENCE_LHS alarm
    doSomething();
}

Compliant Code Example

View with noncompliant examples side by side
if (f() === 42) {
    doSomething();
}

Version

This rule was introduced in DeepScan 1.0.0-alpha.

Was this documentation helpful?