question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

unless x in y compiles to if (x in y)

See original GitHub issue
      unless box in @all
        @boxes.push box
        @all.push box
        if @stopped or @disabled()
          @resetStyle()
        else
          @applyStyle(box, true)
        @scrolled = true

becomes

    for (let i = 0; i < iterable.length; i++) {
      let box = iterable[i];
      if (__in__(box, this.all)) {
        this.boxes.push(box);
        this.all.push(box);
        if (this.stopped || this.disabled()) {
          this.resetStyle();
        } else {
          this.applyStyle(box, true);
        }
        this.scrolled = true;
      }
    }

should be

    for (let i = 0; i < iterable.length; i++) {
      let box = iterable[i];
      if (!__in__(box, this.all)) {
        this.boxes.push(box);
        this.all.push(box);
        if (this.stopped || this.disabled()) {
          this.resetStyle();
        } else {
          this.applyStyle(box, true);
        }
        this.scrolled = true;
      }
    }

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
eventualbuddhacommented, May 9, 2016

I believe all the examples raised on this issue are now fixed in v2.9.1.

0reactions
pvdzcommented, May 9, 2016
unless x instanceof y
  z

->

if (x instanceof y) {
  z;
}

😿

Read more comments on GitHub >

github_iconTop Results From Across the Web

Compressing `x if x else y` statement in Python - Stack Overflow
I'm quite acquainted with Python's ternary operator approach: value = foo if something else ...
Read more >
what does if(x=y) do? - Programming Questions - Arduino Forum
There is nothing wrong with it and no reason it should not compile. The assignment is made and the result of the assignment...
Read more >
Conditionals and Loops - Introduction to Programming in Java
We must declare x and y outside the loop since we will want to access their values after the loop terminates. We don't...
Read more >
Conditionals and logic | Think Java | Trinket
In this case, negating each term means using the “opposite” relational operator. !(x < 5 && y == 3) is the same as...
Read more >
The pass Statement: How to Do Nothing in Python
y = x + 1; print(x, y). The statements inside this type of block are technically called a suite in the Python grammar....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found