[Chrome] CallStack.callStack() missing function name

63 views
Skip to first unread message

Sławomir Mazgaj

unread,
Mar 24, 2017, 3:15:05 PM3/24/17
to Haxe
Hello there. I just noticed some inconsistent behavior when calling `CallStack.callStack()` across the browsers.

My code looks like that:

package sub;

import haxe.CallStack;

class TmpClass 
{
public function new() 
{
}
public function callMeMaybe():Void
{
trace(CallStack.toString(CallStack.callStack()));
}
}

I'm creating an instance of this object and calling this function. I'm expecting to see class name and called function name in call stack and that indeed is the case*.

Firefox:

Called from module sub_TmpClass.prototype.callMeMaybe@http://localhost:2000/CallStack.js:349:39

Called from module Main.main@http://localhost:2000/CallStack.js:56:2
Called from module   CallStack.js:349:3


MS Edge:

Called from sub_TmpClass.prototype.callMeMaybe (http://localhost:2000/CallStack.js line 349)
Called from Main.main (http://localhost:2000/CallStack.js line 56)
Called from local function #null (http://localhost:2000/CallStack.js line 354)
CallStack.js (349,3)



* However....
Chrome:
CallStack.js:349 
Called from Main.main (http://localhost:2000/CallStack.js line 56)


There's no function or class name in Chrome's stack. Anyone know why is that? Is that default behavior in Chrome or maybe I disabled/turned off something by accident. Or anyone does know how to get it (if it's possible)?

Cheers,
Slawomir

Alexander Kuzmenko

unread,
Mar 25, 2017, 4:02:01 PM3/25/17
to Haxe
Try jstack library http://lib.haxe.org/p/jstack/

пятница, 24 марта 2017 г., 22:15:05 UTC+3 пользователь Sławomir Mazgaj написал:

azrafe7

unread,
Mar 25, 2017, 10:34:27 PM3/25/17
to Haxe
This could also be fixed if this https://github.com/HaxeFoundation/haxe/issues/6085 is addressed, _probably_ ;P. 
Anyway it would be worth investigating.

Sławomir Mazgaj

unread,
Mar 27, 2017, 9:29:02 AM3/27/17
to Haxe
Thanks @Alexander, I decided to give jstack a try and results are um... a bit weird.

1st of all it was blowing up:

Http Error #404

this is when I have .js file in same folder as .html. For some reason it's trying to look for a .map in `null` folder.

After putting js files into sub-folder it wasn't blowing up anymore and chrome is giving me:


Called from file:///C:/TMP/CallStack/src/sub/TmpClass.hx line 13
Called from file:///C:/TMP/CallStack/src/Main.hx line 10
Called from file:///C:/HaxeToolkit/haxe/lib/jstack/2,3,1/src/jstack/js/JStack.hx line 74
Called from http.onData (file:///C:/HaxeToolkit/haxe/lib/jstack/2,3,1/src/jstack/js/JStack.hx line 103)
Called from file:///C:/HaxeToolkit/haxe/std/haxe/Http.hx line 272

But that's pretty much the same, because I still can't see function name.
Another weird thing is that Firefox and Edge are showing me exactly same result as before. Any ideas why it's inconsistent across browsers?

Alexander Kuzmenko

unread,
Mar 27, 2017, 9:49:22 AM3/27/17
to Haxe
Inconsitencies across browsers are all over the browsers ) It's web world.
I'd be thankfull if you create an issue in jstack repo with example code and environments setup.

понедельник, 27 марта 2017 г., 16:29:02 UTC+3 пользователь Sławomir Mazgaj написал:

Alexander Kuzmenko

unread,
Mar 27, 2017, 9:50:31 AM3/27/17
to Haxe
However if original CallStack gives you no class/func info, then probably jstack won't help you.

понедельник, 27 марта 2017 г., 16:49:22 UTC+3 пользователь Alexander Kuzmenko написал:

Sławomir Mazgaj

unread,
Mar 27, 2017, 2:35:06 PM3/27/17
to Haxe
I know that there's a lot of inconsistency all over the place in web world, but with a simple Stack Trace? Bit annoying :(

Regarding the issue I decided to go extra mile and I did Pull Request instead.

Cheers!
Reply all
Reply to author
Forward
0 new messages