Skip to content

Commit

Permalink
Fix stacktrace parsing to work on IE 11.
Browse files Browse the repository at this point in the history
On behalf of jleyba.
  • Loading branch information
sevaseva committed Sep 12, 2014
1 parent 467316d commit 2d62a3b
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions javascript/webdriver/stacktrace.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,13 +426,16 @@ webdriver.stacktrace.OPERA_STACK_FRAME_REGEXP_ = new RegExp('^' +

/**
* RegExp pattern for function call in a Chakra (IE) stack trace. This
* expression allows for identifiers like 'Anonymous function', 'eval code',
* and 'Global code'.
* expression creates 2 submatches on the (optional) context and function name,
* matching identifiers like 'foo.Bar.prototype.baz', 'Anonymous function',
* 'eval code', and 'Global code'.
* @private {string}
* @const
*/
webdriver.stacktrace.CHAKRA_FUNCTION_CALL_PATTERN_ = '(' +
webdriver.stacktrace.IDENTIFIER_PATTERN_ + '(?:\\s+\\w+)*)';
webdriver.stacktrace.CHAKRA_FUNCTION_CALL_PATTERN_ =
'(?:(' + webdriver.stacktrace.IDENTIFIER_PATTERN_ +
'(?:\\.' + webdriver.stacktrace.IDENTIFIER_PATTERN_ + ')*)\\.)?' +
'(' + webdriver.stacktrace.IDENTIFIER_PATTERN_ + '(?:\\s+\\w+)*)';


/**
Expand Down Expand Up @@ -518,7 +521,7 @@ webdriver.stacktrace.parseStackFrame_ = function(frameStr) {

m = frameStr.match(webdriver.stacktrace.CHAKRA_STACK_FRAME_REGEXP_);
if (m) {
return new webdriver.stacktrace.Frame('', m[1], '', m[2]);
return new webdriver.stacktrace.Frame(m[1], m[2], '', m[3]);
}

if (frameStr == webdriver.stacktrace.UNKNOWN_CLOSURE_FRAME_ ||
Expand Down

0 comments on commit 2d62a3b

Please sign in to comment.