willtheorangeguy / willtheorangeguy.github.io

Avoid using lexical declarations in case clauses JS-0054
Anti-pattern
Minor
4 months agoa year old
Unexpected lexical declaration in case block
 481        break;
 482
 483      case "image":
 484        function draw() { 485          pJS.canvas.ctx.drawImage( 486            img_obj, 487            p.x - radius, 488            p.y - radius, 489            radius * 2, 490            (radius * 2) / p.img.ratio, 491          ); 492        } 493
 494        if (pJS.tmp.img_type == "svg") {
 495          var img_obj = p.img.obj;