| Index: Source/core/inspector/ContentSearchUtils.cpp
|
| diff --git a/Source/core/inspector/ContentSearchUtils.cpp b/Source/core/inspector/ContentSearchUtils.cpp
|
| index d994fc36231b8c649006a24dff083bec1ace11b0..d241dc055f272a1eccdc65c9cd1f6f4ec2116e99 100644
|
| --- a/Source/core/inspector/ContentSearchUtils.cpp
|
| +++ b/Source/core/inspector/ContentSearchUtils.cpp
|
| @@ -163,25 +163,36 @@ PassRefPtr<TypeBuilder::Array<TypeBuilder::Page::SearchMatch> > searchInTextByLi
|
| return result;
|
| }
|
|
|
| -String findMagicComment(const String& content, const String& name, MagicCommentType commentType)
|
| +static String findMagicComment(const String& content, const String& name, MagicCommentType commentType, bool* deprecated = 0)
|
| {
|
| ASSERT(name.find("=") == notFound);
|
| + if (deprecated)
|
| + *deprecated = false;
|
| String pattern;
|
| + String deprecatedPattern;
|
| switch (commentType) {
|
| case JavaScriptMagicComment:
|
| - pattern= "//@[\040\t]" + createSearchRegexSource(name) + "=[\040\t]*([^\\s\'\"]*)[\040\t]*$";
|
| + pattern = "//#[\040\t]" + createSearchRegexSource(name) + "=[\040\t]*([^\\s\'\"]*)[\040\t]*$";
|
| + deprecatedPattern = "//@[\040\t]" + createSearchRegexSource(name) + "=[\040\t]*([^\\s\'\"]*)[\040\t]*$";
|
| break;
|
| case CSSMagicComment:
|
| - pattern= "/\\*@[\040\t]" + createSearchRegexSource(name) + "=[\040\t]*([^\\s]*)[\040\t]*\\*/[\040\t]*$";
|
| + pattern = "/\\*#[\040\t]" + createSearchRegexSource(name) + "=[\040\t]*([^\\s]*)[\040\t]*\\*/[\040\t]*$";
|
| + deprecatedPattern = "/\\*@[\040\t]" + createSearchRegexSource(name) + "=[\040\t]*([^\\s]*)[\040\t]*\\*/[\040\t]*$";
|
| break;
|
| default:
|
| ASSERT_NOT_REACHED();
|
| return String();
|
| }
|
| RegularExpression regex(pattern, TextCaseSensitive, MultilineEnabled);
|
| + RegularExpression deprecatedRegex(deprecatedPattern, TextCaseSensitive, MultilineEnabled);
|
|
|
| int matchLength;
|
| int offset = regex.match(content, 0, &matchLength);
|
| + if (offset == -1) {
|
| + offset = deprecatedRegex.match(content, 0, &matchLength);
|
| + if (offset != -1 && deprecated)
|
| + *deprecated = true;
|
| + }
|
| if (offset == -1)
|
| return String();
|
|
|
| @@ -204,14 +215,14 @@ String findMagicComment(const String& content, const String& name, MagicCommentT
|
| }
|
| }
|
|
|
| -String findSourceURL(const String& content, MagicCommentType commentType)
|
| +String findSourceURL(const String& content, MagicCommentType commentType, bool* deprecated)
|
| {
|
| - return findMagicComment(content, "sourceURL", commentType);
|
| + return findMagicComment(content, "sourceURL", commentType, deprecated);
|
| }
|
|
|
| -String findSourceMapURL(const String& content, MagicCommentType commentType)
|
| +String findSourceMapURL(const String& content, MagicCommentType commentType, bool* deprecated)
|
| {
|
| - return findMagicComment(content, "sourceMappingURL", commentType);
|
| + return findMagicComment(content, "sourceMappingURL", commentType, deprecated);
|
| }
|
|
|
| } // namespace ContentSearchUtils
|
|
|