Skip to content

Commit

Permalink
Loosen input type to webdriver.stacktrace.getStack_ to account
Browse files Browse the repository at this point in the history
for an rare condition in FF 28+ where the Error() constructor
returns undefined (not sure what causes it, just know it happens)
  • Loading branch information
jleyba committed Apr 30, 2014
1 parent 71cb9e5 commit 363df28
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion javascript/webdriver/stacktrace.js
Original file line number Diff line number Diff line change
Expand Up @@ -562,11 +562,14 @@ webdriver.stacktrace.parseLongFirefoxFrame_ = function(frameStr) {
* V8 prepends the string representation of an error to its stack trace.
* This function trims the string so that the stack trace can be parsed
* consistently with the other JS engines.
* @param {!(Error|goog.testing.JsUnitException)} error The error.
* @param {(Error|goog.testing.JsUnitException)} error The error.
* @return {string} The stack trace string.
* @private
*/
webdriver.stacktrace.getStack_ = function(error) {
if (!error) {
return '';
}
var stack = error.stack || error.stackTrace || '';
var errorStr = error + '\n';
if (goog.string.startsWith(stack, errorStr)) {
Expand Down

0 comments on commit 363df28

Please sign in to comment.