MCPcopy Index your code
hub / github.com/BloombergGraphics/whatiscode / addComment

Function addComment

scripts/libs/esprima.js:344–366  ·  view source on GitHub ↗
(type, value, start, end, loc)

Source from the content-addressed store, hash-verified

342 // 7.4 Comments
343
344 function addComment(type, value, start, end, loc) {
345 var comment;
346
347 assert(typeof start === 'number', 'Comment must have valid position');
348
349 state.lastCommentStart = start;
350
351 comment = {
352 type: type,
353 value: value
354 };
355 if (extra.range) {
356 comment.range = [start, end];
357 }
358 if (extra.loc) {
359 comment.loc = loc;
360 }
361 extra.comments.push(comment);
362 if (extra.attachComment) {
363 extra.leadingComments.push(comment);
364 extra.trailingComments.push(comment);
365 }
366 }
367
368 function skipSingleLineComment(offset) {
369 var start, loc, ch, comment;

Callers 2

skipSingleLineCommentFunction · 0.85
skipMultiLineCommentFunction · 0.85

Calls 1

assertFunction · 0.85

Tested by

no test coverage detected