| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -590,7 +590,7 @@ public Label visit(Literal nd, Context c) { | |||
| 590 | 590 | trapwriter.addTuple("literals", valueString, source, key); | |
| 591 | 591 | Position start = nd.getLoc().getStart(); | |
| 592 | 592 | com.semmle.util.locations.Position startPos = new com.semmle.util.locations.Position(start.getLine(), start.getColumn() + 1 /* Convert from 0-based to 1-based. */, start.getOffset()); | |
| 593 | - | ||
| 593 | + | ||
| 594 | 594 | if (nd.isRegExp()) { | |
| 595 | 595 | OffsetTranslation offsets = new OffsetTranslation(); | |
| 596 | 596 | offsets.set(0, 1); // skip the initial '/' | |
@@ -622,7 +622,7 @@ private boolean isOctalDigit(char ch) { | |||
| 622 | 622 | /** | |
| 623 | 623 | * Constant-folds simple string concatenations in `exp` while keeping an offset translation | |
| 624 | 624 | * that tracks back to the original source. | |
| 625 | - */ | ||
| 625 | + */ | ||
| 626 | 626 | private Pair<String, OffsetTranslation> getStringConcatResult(Expression exp) { | |
| 627 | 627 | if (exp instanceof BinaryExpression) { | |
| 628 | 628 | BinaryExpression be = (BinaryExpression) exp; | |
@@ -636,7 +636,7 @@ private Pair<String, OffsetTranslation> getStringConcatResult(Expression exp) { | |||
| 636 | 636 | if (str.length() > 1000) { | |
| 637 | 637 | return null; | |
| 638 | 638 | } | |
| 639 | - | ||
| 639 | + | ||
| 640 | 640 | int delta = be.getRight().getLoc().getStart().getOffset() - be.getLeft().getLoc().getStart().getOffset(); | |
| 641 | 641 | int offset = left.fst().length(); | |
| 642 | 642 | return Pair.make(str, left.snd().append(right.snd(), offset, delta)); | |
@@ -848,14 +848,14 @@ public Label visit(AssignmentExpression nd, Context c) { | |||
| 848 | 848 | public Label visit(BinaryExpression nd, Context c) { | |
| 849 | 849 | Label key = super.visit(nd, c); | |
| 850 | 850 | if (nd.getOperator().equals("in") && nd.getLeft() instanceof Identifier && ((Identifier)nd.getLeft()).getName().startsWith("#")) { | |
| 851 | - // this happens with Ergonomic brand checks for Private Fields (see https://github.com/tc39/proposal-private-fields-in-in). | ||
| 851 | + // this happens with Ergonomic brand checks for Private Fields (see https://github.com/tc39/proposal-private-fields-in-in). | ||
| 852 | 852 | // it's the only case where private field identifiers are used not as a field. | |
| 853 | 853 | visit(nd.getLeft(), key, 0, IdContext.LABEL, true); | |
| 854 | 854 | } else { | |
| 855 | 855 | visit(nd.getLeft(), key, 0, true); | |
| 856 | 856 | } | |
| 857 | 857 | visit(nd.getRight(), key, 1, true); | |
| 858 | - | ||
| 858 | + | ||
| 859 | 859 | extractRegxpFromBinop(nd, c); | |
| 860 | 860 | return key; | |
| 861 | 861 | } | |
@@ -1815,7 +1815,7 @@ public Label visit(ImportSpecifier nd, Context c) { | |||
| 1815 | 1815 | visit(nd.getLocal(), lbl, 1, nd.hasTypeKeyword() ? IdContext.TYPE_ONLY_IMPORT : c.idcontext); | |
| 1816 | 1816 | if (nd.hasTypeKeyword()) { | |
| 1817 | 1817 | trapwriter.addTuple("has_type_keyword", lbl); | |
| 1818 | - } | ||
| 1818 | + } | ||
| 1819 | 1819 | return lbl; | |
| 1820 | 1820 | } | |
| 1821 | 1821 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments