MCPcopy
hub / github.com/Tampermonkey/tampermonkey / number

Function number

src/jslint.js:1386–1414  ·  view source on GitHub ↗
(snippet)

Source from the content-addressed store, hash-verified

1384 }
1385
1386 function number(snippet) {
1387 var digit;
1388 if (xmode !== 'style' && xmode !== 'styleproperty' &&
1389 source_row.charAt(0).isAlpha()) {
1390 warn_at('expected_space_a_b',
1391 line, character, c, source_row.charAt(0));
1392 }
1393 if (c === '0') {
1394 digit = snippet.charAt(1);
1395 if (digit.isDigit()) {
1396 if (token.id !== '.' && xmode !== 'styleproperty') {
1397 warn_at('unexpected_a', line, character, snippet);
1398 }
1399 } else if (json_mode && (digit === 'x' || digit === 'X')) {
1400 warn_at('unexpected_a', line, character, '0x');
1401 }
1402 }
1403 if (snippet.slice(snippet.length - 1) === '.') {
1404 warn_at('trailing_decimal_a', line, character, snippet);
1405 }
1406 if (xmode !== 'style') {
1407 digit = +snippet;
1408 if (!isFinite(digit)) {
1409 warn_at('bad_number', line, character, snippet);
1410 }
1411 snippet = digit;
1412 }
1413 return it('(number)', snippet);
1414 }
1415
1416 function comment(snippet) {
1417 if (comments_off || src || (xmode && xmode !== 'script' &&

Callers 1

jslint.jsFile · 0.85

Calls 2

warn_atFunction · 0.85
itFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…