Skip to content

unclear use of comma operator in settings_leds.htm #4321

Closed

Description

@softhack007

I'm not sure if this line does the right thing;
actually my IDE (CLion) warned me of a "comma expression that may lead to subtle bugs".

https://github.com/Aircoookie/WLED/blob/5b989adebc666f5d6314e0ece81c1141a0ae454f/wled00/data/settings_leds.htm#L53

Either the comma is not needed here --> replace with ";"
Or it has a very special intention ?? --> maybe add a comment to explain?

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comma_operator#using_the_comma_operator_to_join_assignments

Activity

  1. added
    needs investigation
    javascript
    on Nov 25, 2024
  2. blazoncek commented on Nov 26, 2024

    @blazoncek
    Contributor
    function bLimits(b,v,p,m,l,o=5,d=2,a=6) {
    	oMaxB = maxB = b; // maxB - max buses (can be changed if using ESP32 parallel I2S)
    	maxD = d; // maxD - max digital channels (can be changed if using ESP32 parallel I2S)
    	maxA = a; // maxA - max analog channels
    	maxV = v; // maxV - min virtual buses
    	maxPB = p; // maxPB - max LEDs per bus
    	maxM = m; // maxM - max LED memory
    	maxL = l; // maxL - max LEDs (will serve to determine ESP >1664 == ESP32)
    	maxCO = o; // maxCO - max Color Order mappings
    }
  3. softhack007 commented on Nov 27, 2024

    @softhack007
    MemberAuthor
  4. added a commit that references this issue on Nov 27, 2024
  5. added
    fixed in source
    on Nov 27, 2024
  6. linked a pull request that will close this issueFix for #4321 #4328on Nov 27, 2024
  7. added 2 commits that reference this issue on Nov 27, 2024
  8. removed
    needs investigation
    on Nov 28, 2024
  9. added 2 commits that reference this issue on Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixed in sourcejavascript

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions