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

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

Issue 2349343002: DevTools: introduce persistence/ module (Closed)
Patch Set: reupload 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..d46a02ddb2003d690ec05b11f17c81301166b911 100644
--- a/third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js
+++ b/third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js
@@ -286,7 +286,6 @@ WebInspector.ResourceScriptFile = function(resourceScriptMapping, uiSourceCode,
this._resourceScriptMapping = resourceScriptMapping;
this._uiSourceCode = uiSourceCode;
- this._uiSourceCode.forceLoadOnCheckContent();
if (this._uiSourceCode.contentType().isScript())
this._script = scripts[0];
@@ -325,19 +324,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