Chromium Code Reviews| 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; |
| }, |
| /** |