New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 669085 link

Starred by 18 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Nov 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

window.onerror's Error object stack is truncated

Reported by timer...@gmail.com, Nov 28 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36

Steps to reproduce the problem:
1. Assign a handler to window.onerror
2. Inspect the Error.stack provided (or console.log it)
3. Notice that the stack is truncated

What is the expected behavior?
The following should be printed to console:

Error: testing
at f14 (sample.js:41)
at f13 (sample.js:38)
at f12 (sample.js:35)
at f11 (sample.js:32)
at f10 (sample.js:29)
at f9 (sample.js:26)
at f8 (sample.js:23)
at f7 (sample.js:20)
at f6 (sample.js:17)
at f5 (sample.js:14)
at f4 (sample.js:11)
at f3 (sample.js:8)
at f2 (sample.js:5)
at f1 (sample.js:2)
at (anonymous function) (sample.js:52)

What went wrong?
The stack in the object is truncated, see below (missing f4 to f1 & anonymous):

Error: testing
at f14 (sample.js:41)
at f13 (sample.js:38)
at f12 (sample.js:35)
at f11 (sample.js:32)
at f10 (sample.js:29)
at f9 (sample.js:26)
at f8 (sample.js:23)
at f7 (sample.js:20)
at f6 (sample.js:17)
at f5 (sample.js:14)

Did this work before? No 

Does this work in other browsers? N/A

Chrome version: 54.0.2840.71  Channel: stable
OS Version: 10.0
Flash Version: Shockwave Flash 23.0 r0

Could the Error.stack be populated with the full stack? Thanks!
 
error-sample.zip
657 bytes Download

Comment 1 by vje...@gmail.com, Nov 28 2016

Some context around this bug: https://twitter.com/dan_abramov/status/803292105514881025
Components: Blink>JavaScript
Labels: Needs-Feedback Needs-Triage-M54 M-54
Could you please provide a sample testcase for the ease of finding regression.

Comment 3 by vje...@gmail.com, Nov 29 2016

There is a test cased attached to the original report: error-sample.zip

Comment 4 by mihaip@chromium.org, Nov 29 2016

Cc: mihaip@chromium.org
Status: WontFix (was: Unconfirmed)
You can control the size of the captured stack trace by setting the value of Error.stackTraceLimit (using `Infinity` for no limit). For more details see https://github.com/v8/v8/wiki/Stack-Trace-API.

Comment 5 by timer...@gmail.com, Nov 29 2016

I think it's odd that the stack trace limit differs from the Error object in onerror to the console's one. Could these be made consistent to prevent misunderstandings?

Sign in to add a comment