Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(700)

Unified Diff: third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js

Issue 2077363003: DevTools: similarly to the way we match scripts ignoring sourceurl comments, ignore framework-speci… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js b/third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js
index 11174402c239b4f7b9623571a0007949b1f21807..a6e4332c826e8a18734504270347a4a7a50d7266 100644
--- a/third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js
+++ b/third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js
@@ -320,10 +320,21 @@ WebInspector.ResourceScriptFile.prototype = {
return false;
if (typeof this._scriptSource === "undefined")
return false;
- if (!this._uiSourceCode.workingCopy().startsWith(this._scriptSource.trimRight()))
- return true;
- var suffix = this._uiSourceCode.workingCopy().substr(this._scriptSource.length);
- return !!suffix.length && !suffix.match(WebInspector.Script.sourceURLRegex);
+ var workingCopy = this._uiSourceCode.workingCopy();
+
+ // Match ignoring sourceURL.
+ if (workingCopy.startsWith(this._scriptSource.trimRight())) {
+ var suffix = this._uiSourceCode.workingCopy().substr(this._scriptSource.length);
dgozman 2016/06/20 16:17:42 Should we strip |this._scriptSource.trimRight().le
pfeldman 2016/06/21 08:50:46 They produce 'opposite' checks, so i'd rather not.
+ return !!suffix.length && !suffix.match(WebInspector.Script.sourceURLRegex);
+ }
+
+ // Match ignoring Node wrapper.
+ var nodePrefix = "(function (exports, require, module, __filename, __dirname) { ";
+ var nodeSuffix = "\n});";
+ if (workingCopy == nodePrefix + this._scriptSource + nodeSuffix)
dgozman 2016/06/20 16:17:42 ===
pfeldman 2016/06/21 08:50:46 Done.
+ return false;
+
+ return true;
},
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698