Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 313 * @return {boolean} | 313 * @return {boolean} |
| 314 */ | 314 */ |
| 315 _isDiverged: function() | 315 _isDiverged: function() |
| 316 { | 316 { |
| 317 if (this._uiSourceCode.isDirty()) | 317 if (this._uiSourceCode.isDirty()) |
| 318 return true; | 318 return true; |
| 319 if (!this._script) | 319 if (!this._script) |
| 320 return false; | 320 return false; |
| 321 if (typeof this._scriptSource === "undefined") | 321 if (typeof this._scriptSource === "undefined") |
| 322 return false; | 322 return false; |
| 323 if (!this._uiSourceCode.workingCopy().startsWith(this._scriptSource.trim Right())) | 323 var workingCopy = this._uiSourceCode.workingCopy(); |
| 324 return true; | 324 |
| 325 var suffix = this._uiSourceCode.workingCopy().substr(this._scriptSource. length); | 325 // Match ignoring sourceURL. |
| 326 return !!suffix.length && !suffix.match(WebInspector.Script.sourceURLReg ex); | 326 if (workingCopy.startsWith(this._scriptSource.trimRight())) { |
| 327 var suffix = this._uiSourceCode.workingCopy().substr(this._scriptSou rce.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.
| |
| 328 return !!suffix.length && !suffix.match(WebInspector.Script.sourceUR LRegex); | |
| 329 } | |
| 330 | |
| 331 // Match ignoring Node wrapper. | |
| 332 var nodePrefix = "(function (exports, require, module, __filename, __dir name) { "; | |
| 333 var nodeSuffix = "\n});"; | |
| 334 if (workingCopy == nodePrefix + this._scriptSource + nodeSuffix) | |
|
dgozman
2016/06/20 16:17:42
===
pfeldman
2016/06/21 08:50:46
Done.
| |
| 335 return false; | |
| 336 | |
| 337 return true; | |
| 327 }, | 338 }, |
| 328 | 339 |
| 329 /** | 340 /** |
| 330 * @param {!WebInspector.Event} event | 341 * @param {!WebInspector.Event} event |
| 331 */ | 342 */ |
| 332 _workingCopyChanged: function(event) | 343 _workingCopyChanged: function(event) |
| 333 { | 344 { |
| 334 this._update(); | 345 this._update(); |
| 335 }, | 346 }, |
| 336 | 347 |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 472 /** | 483 /** |
| 473 * @return {boolean} | 484 * @return {boolean} |
| 474 */ | 485 */ |
| 475 hasSourceMapURL: function() | 486 hasSourceMapURL: function() |
| 476 { | 487 { |
| 477 return this._script && !!this._script.sourceMapURL; | 488 return this._script && !!this._script.sourceMapURL; |
| 478 }, | 489 }, |
| 479 | 490 |
| 480 __proto__: WebInspector.Object.prototype | 491 __proto__: WebInspector.Object.prototype |
| 481 } | 492 } |
| OLD | NEW |