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

function f() {
    return 42;
}
if (f() = 42) { // NON_REFERENCE_LHS alarm
    good = true;
}

Compliant Code Example

function f() {
    return 42;
}
if (f() === 42) {
    good = true;
}

Version

This rule was introduced in DeepScan 1.0.0-alpha.