MCPcopy Index your code
hub / github.com/PaulTaykalo/objc-dependency-visualizer / warnUnused

Function warnUnused

Scripts/ace/worker-javascript.js:7330–7362  ·  view source on GitHub ↗
(name, tkn, type, unused_opt)

Source from the content-addressed store, hash-verified

7328 };
7329
7330 var warnUnused = function(name, tkn, type, unused_opt) {
7331 var line = tkn.line;
7332 var chr = tkn.from;
7333 var raw_name = tkn.raw_text || name;
7334
7335 if (unused_opt === undefined) {
7336 unused_opt = state.option.unused;
7337 }
7338
7339 if (unused_opt === true) {
7340 unused_opt = "last-param";
7341 }
7342
7343 var warnable_types = {
7344 "vars": ["var"],
7345 "last-param": ["var", "param"],
7346 "strict": ["var", "param", "last-param"]
7347 };
7348
7349 if (unused_opt) {
7350 if (warnable_types[unused_opt] && warnable_types[unused_opt].indexOf(type) !== -1) {
7351 if (!tkn.exported) {
7352 warningAt("W098", line, chr, raw_name);
7353 }
7354 }
7355 }
7356
7357 unuseds.push({
7358 name: name,
7359 line: line,
7360 character: chr
7361 });
7362 };
7363
7364 var checkUnused = function(func, key) {
7365 var type = func[key];

Callers 2

checkUnusedFunction · 0.85
itselfFunction · 0.85

Calls 1

warningAtFunction · 0.85

Tested by

no test coverage detected