OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * The type of the stack trace object. The definition is based on | 6 * The type of the stack trace object. The definition is based on |
7 * extensions/browser/extension_error.cc:RuntimeError::ToValue(). | 7 * extensions/browser/extension_error.cc:RuntimeError::ToValue(). |
8 * @typedef {{columnNumber: number, | 8 * @typedef {{columnNumber: number, |
9 * functionName: string, | 9 * functionName: string, |
10 * lineNumber: number, | 10 * lineNumber: number, |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 // with that frame. | 235 // with that frame. |
236 frameNode.addEventListener('click', function(frame, frameNode, e) { | 236 frameNode.addEventListener('click', function(frame, frameNode, e) { |
237 this.setActiveFrame_(frameNode); | 237 this.setActiveFrame_(frameNode); |
238 | 238 |
239 // Request the file source with the section highlighted; this will | 239 // Request the file source with the section highlighted; this will |
240 // call ExtensionErrorOverlay.requestFileSourceResponse() when | 240 // call ExtensionErrorOverlay.requestFileSourceResponse() when |
241 // completed, which in turn calls setCode(). | 241 // completed, which in turn calls setCode(). |
242 ExtensionErrorOverlay.requestFileSource( | 242 ExtensionErrorOverlay.requestFileSource( |
243 {extensionId: this.error_.extensionId, | 243 {extensionId: this.error_.extensionId, |
244 message: this.error_.message, | 244 message: this.error_.message, |
245 pathSuffix: getRelativeUrl(frame.url, this.extensionUrl_), | 245 pathSuffix: getRelativeUrl(frame.url, |
| 246 assert(this.extensionUrl_)), |
246 lineNumber: frame.lineNumber}); | 247 lineNumber: frame.lineNumber}); |
247 }.bind(this, frame, frameNode)); | 248 }.bind(this, frame, frameNode)); |
248 | 249 |
249 this.stackTrace_.appendChild(frameNode); | 250 this.stackTrace_.appendChild(frameNode); |
250 } | 251 } |
251 | 252 |
252 // Set the current stack frame to the first stack frame and show the | 253 // Set the current stack frame to the first stack frame and show the |
253 // trace, if one exists. (We can't just check error.stackTrace, because | 254 // trace, if one exists. (We can't just check error.stackTrace, because |
254 // it's possible the trace was purely internal, and we don't show | 255 // it's possible the trace was purely internal, and we don't show |
255 // internal frames.) | 256 // internal frames.) |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 var overlay = extensions.ExtensionErrorOverlay.getInstance(); | 536 var overlay = extensions.ExtensionErrorOverlay.getInstance(); |
536 overlay.setCode(result); | 537 overlay.setCode(result); |
537 overlay.setVisible(true); | 538 overlay.setVisible(true); |
538 }; | 539 }; |
539 | 540 |
540 // Export | 541 // Export |
541 return { | 542 return { |
542 ExtensionErrorOverlay: ExtensionErrorOverlay | 543 ExtensionErrorOverlay: ExtensionErrorOverlay |
543 }; | 544 }; |
544 }); | 545 }); |
OLD | NEW |