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

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

Issue 2349343002: DevTools: introduce persistence/ module (Closed)
Patch Set: DevTools: add persistence/ module Created 4 years, 3 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
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 b608b13e512f2c56cb3167c4245f4025b4e71bb6..d0a6a5d50ad71aa0c6ed0c87758564025f7d2386 100644
--- a/third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js
+++ b/third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js
@@ -325,19 +325,10 @@ WebInspector.ResourceScriptFile.prototype = {
var workingCopy = this._uiSourceCode.workingCopy();
// Match ignoring sourceURL.
- if (workingCopy.startsWith(this._scriptSource.trimRight())) {
- var suffix = this._uiSourceCode.workingCopy().substr(this._scriptSource.length);
- return !!suffix.length && !suffix.match(WebInspector.Script.sourceURLRegex);
- }
-
- // Match ignoring Node wrapper.
- var nodePrefix = "(function (exports, require, module, __filename, __dirname) { \n";
- var nodeSuffix = "\n});";
- if (workingCopy.startsWith("#!/usr/bin/env node\n"))
- workingCopy = workingCopy.substring("#!/usr/bin/env node\n".length);
- if (this._scriptSource === nodePrefix + workingCopy + nodeSuffix)
- return false;
- return true;
+ if (!workingCopy.startsWith(this._scriptSource.trimRight()))
+ return true;
+ var suffix = this._uiSourceCode.workingCopy().substr(this._scriptSource.length);
+ return !!suffix.length && !suffix.match(WebInspector.Script.sourceURLRegex);
},
/**

Powered by Google App Engine
This is Rietveld 408576698