Skip to content

Commit dcad1a3

Browse files
author
Erwin Dondorp
committed
extra warning for Object.entries/Object.values, which are only available from ES8/2017
1 parent 1959109 commit dcad1a3

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

saltgui/static/scripts/output/OutputHighstate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export class OutputHighstate {
4747
static getHighStateLabel (pMinionId, pMinionResponse) {
4848
let anyFailures = false;
4949
let anySkips = false;
50-
// do not use Object.entries, that is not supported by the test framework
50+
// do not use Object.entries, that is not supported by the test framework as it is ES8/2017
5151
for (const taskKey of Object.keys(pMinionResponse)) {
5252
const task = pMinionResponse[taskKey];
5353
if (task.result === null) {

saltgui/static/scripts/output/OutputHighstateTaskSaltGui.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export class OutputHighstateTaskSaltGui {
153153
}
154154

155155
// show any unknown attribute of a task
156-
// do not use Object.entries, that is not supported by the test framework
156+
// do not use Object.entries, that is not supported by the test framework as it is ES8/2017
157157
for (const key of Object.keys(pTask)) {
158158
const item = pTask[key];
159159
/* eslint-disable line-comment-position,no-inline-comments,curly */

saltgui/static/scripts/output/OutputJson.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class OutputJson {
3838
return "{ }";
3939
}
4040

41-
// do not use Object.values as eslint does understand that
41+
// do not use Object.values as eslint does understand that because it is ES8/2017
4242
if (!Array.isArray(pValue) && Object.keys(pValue).length === 1 && typeof pValue[Object.keys(pValue)[0]] !== "object") {
4343
// show the brackets for a simple object a bit wider apart
4444
return "{ " + JSON.stringify(Object.keys(pValue)[0]) + ": " + JSON.stringify(pValue[Object.keys(pValue)[0]]) + " }";
@@ -77,7 +77,7 @@ export class OutputJson {
7777
// put each name+value on its own line
7878
str = "{";
7979
let oSeparator = "";
80-
// do not use Object.entries, that is not supported by the test framework
80+
// do not use Object.entries, that is not supported by the test framework as it is ES8/2017
8181
const sortedKeys = Object.keys(pValue).sort((aa, bb) => aa.localeCompare(bb, "en", {"numeric": true}));
8282
for (const key of sortedKeys) {
8383
const item = pValue[key];

0 commit comments

Comments
 (0)