|
Last change
on this file was 28036, checked in by marder, 11 months ago |
|
rmgen: var -> let -> const
One should always use the variable declaration with the least possible scope.
This patch cleans up many (but not all) of the var in rmgen and replaces them with let or const.
The same is done for let -> const.
comments by: @sera @Stan
Differential revision: https://code.wildfiregames.com/D5214
|
-
Property svn:eol-style
set to
native
|
|
File size:
360 bytes
|
| Line | |
|---|
| 1 | /**
|
|---|
| 2 | * The MultiPainter applies several painters to the given area.
|
|---|
| 3 | */
|
|---|
| 4 | function MultiPainter(painters)
|
|---|
| 5 | {
|
|---|
| 6 | if (painters instanceof Array)
|
|---|
| 7 | this.painters = painters;
|
|---|
| 8 | else if (!painters)
|
|---|
| 9 | this.painters = [];
|
|---|
| 10 | else
|
|---|
| 11 | this.painters = [painters];
|
|---|
| 12 | }
|
|---|
| 13 |
|
|---|
| 14 | MultiPainter.prototype.paint = function(area)
|
|---|
| 15 | {
|
|---|
| 16 | for (const painter of this.painters)
|
|---|
| 17 | painter.paint(area);
|
|---|
| 18 | };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.