-
Notifications
You must be signed in to change notification settings - Fork 818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changed block.js to update to ES6 syntax #3032
Conversation
Related to issue #2629 |
offScreen(boundary) { | ||
return !this.trash && boundary.offScreen(this.container.x, this.container.y); | ||
} | ||
//changed to arrow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to insert these comments.. they are implicit in the PR and not useful to someone reading the code later.
this.docks.push([obj[1][i][0], obj[1][i][1], "anyin"]); | ||
} | ||
} this.docks.push([obj[1][i][0], obj[1][i][1], "anyin"]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this about?
@@ -758,18 +760,21 @@ class Block { | |||
|
|||
switch (this.name) { | |||
case "nameddoArg": | |||
for (let i = 1; i < obj[1].length - 1; i++) { | |||
//CHANGED | |||
for (let i of obj[1].length - 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this work? i starts at 1, not 0.
for (let i = 1; i < obj[1].length; i++) { | ||
this.docks.push([obj[1][i][0], obj[1][i][1], "anyin"]); | ||
//CHANGEd | ||
for (let i of obj[1].length) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i starts at 1
|
||
for (let i = 1; i < that.protoblock.staticLabels.length; i++) { | ||
//CHANGED | ||
for (let i = 1 of that.protoblock.staticLabels.length) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this correct?
|
||
for (let i = 1; i < that.protoblock.staticLabels.length; i++) { | ||
//CHANGED | ||
for (let i of that.protoblock.staticLabels.length) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i starts at 1
|
||
for (let i = 1; i < this.protoblock.staticLabels.length; i++) { | ||
//CHANGED | ||
for (let i of this.protoblock.staticLabels.length) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i starts at 1
isNoHitBlock() { | ||
return NOHIT.indexOf(this.name) !== -1; | ||
} | ||
//Changed to arrow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not that it impacts the code, but changing the order of these functions makes it harder to review.
Sorry to take so long reviewing this... I somehow overlooked it. |
I updated some for loops and function definitions to ES6+ syntax.