window.onerror's Error object stack is truncated
Reported by
timer...@gmail.com,
Nov 28 2016
|
|||
Issue descriptionUserAgent: 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!
,
Nov 28 2016
Could you please provide a sample testcase for the ease of finding regression.
,
Nov 29 2016
There is a test cased attached to the original report: error-sample.zip
,
Nov 29 2016
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.
,
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 |
|||
Comment 1 by vje...@gmail.com
, Nov 28 2016