File tree Expand file tree Collapse file tree 4 files changed +49
-0
lines changed
src/semmle/javascript/dependencies
test/query-tests/filters/ClassifyFiles Expand file tree Collapse file tree 4 files changed +49
-0
lines changed Original file line number Diff line number Diff line change @@ -843,6 +843,41 @@ private class ApplicationInsights extends FrameworkLibraryWithURLRegex {
843843 }
844844}
845845
846+ /**
847+ * The twitter-text framework.
848+ */
849+ private class TwitterText extends FrameworkLibraryWithGenericURL , FrameworkLibraryWithMarkerComment {
850+ TwitterText ( ) { this = "twitter-text" }
851+
852+ override string getAMarkerCommentRegex ( ) {
853+ result = "(?s).*twitter-text\\s*(<VERSION>).*"
854+ }
855+ }
856+
857+ /**
858+ * The classic version of twitter-text, as seen in the wild.
859+ */
860+ private class TwitterTextClassic extends FrameworkLibraryWithURLRegex {
861+ TwitterTextClassic ( ) { this = "twitter-text" }
862+
863+ override string getAURLRegex ( ) {
864+ result = ".*(?:^|/)twitter_text" + variantRegex ( ) + "\\.js"
865+ }
866+ }
867+
868+ /**
869+ * A copy of twitter-text.
870+ */
871+ private class TwitterTextClassicInstance extends FrameworkLibraryInstance {
872+ TwitterTextClassicInstance ( ) {
873+ this .( TopLevel ) .getFile ( ) .getAbsolutePath ( ) .regexpMatch ( any ( TwitterTextClassic t ) .getAURLRegex ( ) )
874+ }
875+ override predicate info ( FrameworkLibrary fl , string v ) {
876+ fl instanceof TwitterTextClassic and
877+ v = ""
878+ }
879+ }
880+
846881/**
847882 * A `FrameworkLibraryReference` that refers to a recognised `FrameworkLibraryInstance`,
848883 * that is, a `<script>` tag where the `src` attribute can be resolved to a local file
Original file line number Diff line number Diff line change 1919| tmpl.html:0:0:0:0 | tmpl.html | template |
2020| tst.browserify.js:0:0:0:0 | tst.browserify.js | generated |
2121| tst.dart.js:0:0:0:0 | tst.dart.js | generated |
22+ | twitter-text.js:0:0:0:0 | twitter-text.js | library |
23+ | twitter_text.js:0:0:0:0 | twitter_text.js | library |
2224| unannotated-externs-1.js:0:0:0:0 | unannotated-externs-1.js | externs |
2325| unannotated-externs-2.js:0:0:0:0 | unannotated-externs-2.js | externs |
2426| unannotated-externs-3.js:0:0:0:0 | unannotated-externs-3.js | externs |
Original file line number Diff line number Diff line change 1+ /*!
2+ * twitter-text 2.0.4
3+ *
4+ * Copyright 2012 Twitter, Inc.
5+ *
6+ * Licensed under the Apache License, Version 2.0 (the "License");
7+ * you may not use this work except in compliance with the License.
8+ * You may obtain a copy of the License at:
9+ *
10+ * http://www.apache.org/licenses/LICENSE-2.0
11+ */
Original file line number Diff line number Diff line change 1+ // classic version of twitter-text, as seen in the wild
You can’t perform that action at this time.
0 commit comments