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

Side by Side Diff: Source/devtools/front_end/console/ConsoleViewMessage.js

Issue 369333002: DevTools: Added error message when the command is invoked from the console with exception (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@add-evaluate-exception-details
Patch Set: Created 6 years, 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 continue; 337 continue;
338 } 338 }
339 339
340 if (typeof parameters[i] === "object") 340 if (typeof parameters[i] === "object")
341 parameters[i] = target.runtimeModel.createRemoteObject(parameter s[i]); 341 parameters[i] = target.runtimeModel.createRemoteObject(parameter s[i]);
342 else 342 else
343 parameters[i] = target.runtimeModel.createRemoteObjectFromPrimit iveValue(parameters[i]); 343 parameters[i] = target.runtimeModel.createRemoteObjectFromPrimit iveValue(parameters[i]);
344 } 344 }
345 345
346 // There can be string log and string eval result. We distinguish betwee n them based on message type. 346 // There can be string log and string eval result. We distinguish betwee n them based on message type.
347 var shouldFormatMessage = WebInspector.RemoteObject.type(parameters[0]) === "string" && this._message.type !== WebInspector.ConsoleMessage.MessageType.R esult; 347 var shouldFormatMessage = WebInspector.RemoteObject.type(parameters[0]) === "string" && (this._message.type !== WebInspector.ConsoleMessage.MessageType. Result || this._message.level === WebInspector.ConsoleMessage.MessageLevel.Error );
348 348
349 // Multiple parameters with the first being a format string. Save unused substitutions. 349 // Multiple parameters with the first being a format string. Save unused substitutions.
350 if (shouldFormatMessage) { 350 if (shouldFormatMessage) {
351 // Multiple parameters with the first being a format string. Save un used substitutions. 351 // Multiple parameters with the first being a format string. Save un used substitutions.
352 var result = this._formatWithSubstitutionString(parameters[0].descri ption, parameters.slice(1), formattedResult); 352 var result = this._formatWithSubstitutionString(parameters[0].descri ption, parameters.slice(1), formattedResult);
353 parameters = result.unusedSubstitutions; 353 parameters = result.unusedSubstitutions;
354 if (parameters.length) 354 if (parameters.length)
355 formattedResult.appendChild(document.createTextNode(" ")); 355 formattedResult.appendChild(document.createTextNode(" "));
356 } 356 }
357 357
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after
1261 { 1261 {
1262 if (!this._wrapperElement) { 1262 if (!this._wrapperElement) {
1263 WebInspector.ConsoleViewMessage.prototype.toMessageElement.call(this ); 1263 WebInspector.ConsoleViewMessage.prototype.toMessageElement.call(this );
1264 this._wrapperElement.classList.toggle("collapsed", this._collapsed); 1264 this._wrapperElement.classList.toggle("collapsed", this._collapsed);
1265 } 1265 }
1266 return this._wrapperElement; 1266 return this._wrapperElement;
1267 }, 1267 },
1268 1268
1269 __proto__: WebInspector.ConsoleViewMessage.prototype 1269 __proto__: WebInspector.ConsoleViewMessage.prototype
1270 } 1270 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/console/ConsoleView.js ('k') | Source/devtools/front_end/sdk/ConsoleModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698