~endlessm/jasmine-gjs/trunk

« back to all changes in this revision

Viewing changes to src/options.js

  • Committer: Philip Chimento
  • Date: 2020-08-15 18:13:47 UTC
  • Revision ID: git-v1:452c83fe6c924d5b94315b98e189441971960dc2
let -> const

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
 
55
55
function parseOptions(argv) {
56
56
    argv = argv.slice();  // Make a copy
57
 
    let namespace = {};
58
 
    let files = [];
 
57
    const namespace = {};
 
58
    const files = [];
59
59
 
60
60
    Object.keys(ARGS).forEach(function (argName) {
61
 
        let argInfo = ARGS[argName];
62
 
        let dest = argInfo.dest || argName;
 
61
        const argInfo = ARGS[argName];
 
62
        const dest = argInfo.dest || argName;
63
63
        if (typeof argInfo.default !== 'undefined')
64
64
            namespace[dest] = argInfo.default;
65
65
    });
71
71
            continue;
72
72
        }
73
73
 
74
 
        let argName = argvElement.slice(2);
 
74
        const argName = argvElement.slice(2);
75
75
        if (!(argName in ARGS)) {
76
76
            printerr('warning: Unknown argument "%s"'.format(argName));
77
77
            continue;
78
78
        }
79
79
 
80
 
        let argInfo = ARGS[argName];
81
 
        let dest = argInfo.dest || argName;
 
80
        const argInfo = ARGS[argName];
 
81
        const dest = argInfo.dest || argName;
82
82
        let value;
83
83
        switch (argInfo.action) {
84
84
        case 'help':