Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,41 @@ private class ApplicationInsights extends FrameworkLibraryWithURLRegex {
}
}

/**
* The twitter-text framework.
*/
private class TwitterText extends FrameworkLibraryWithGenericURL, FrameworkLibraryWithMarkerComment {
TwitterText() { this = "twitter-text" }

override string getAMarkerCommentRegex() {
result = "(?s).*twitter-text\\s*(<VERSION>).*"
}
}

/**
* The classic version of twitter-text, as seen in the wild.
*/
private class TwitterTextClassic extends FrameworkLibraryWithURLRegex {
TwitterTextClassic() { this = "twitter-text" }

override string getAURLRegex() {
result = ".*(?:^|/)twitter_text" + variantRegex() + "\\.js"
}
}

/**
* A copy of twitter-text.
*/
private class TwitterTextClassicInstance extends FrameworkLibraryInstance {
TwitterTextClassicInstance() {
this.(TopLevel).getFile().getAbsolutePath().regexpMatch(any(TwitterTextClassic t).getAURLRegex())
}
override predicate info(FrameworkLibrary fl, string v) {
fl instanceof TwitterTextClassic and
v = ""
}
}

/**
* A `FrameworkLibraryReference` that refers to a recognised `FrameworkLibraryInstance`,
* that is, a `<script>` tag where the `src` attribute can be resolved to a local file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
| tmpl.html:0:0:0:0 | tmpl.html | template |
| tst.browserify.js:0:0:0:0 | tst.browserify.js | generated |
| tst.dart.js:0:0:0:0 | tst.dart.js | generated |
| twitter-text.js:0:0:0:0 | twitter-text.js | library |
| twitter_text.js:0:0:0:0 | twitter_text.js | library |
| unannotated-externs-1.js:0:0:0:0 | unannotated-externs-1.js | externs |
| unannotated-externs-2.js:0:0:0:0 | unannotated-externs-2.js | externs |
| unannotated-externs-3.js:0:0:0:0 | unannotated-externs-3.js | externs |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*!
* twitter-text 2.0.4
*
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this work except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*/
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// classic version of twitter-text, as seen in the wild