Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Stack trace
Fri, Jun 2 2017 9:02 AMPermanent Link

Matthew Jones

Should you ever need to get a stack trace, for debug purposes only of course, there is a generic JavaScript project that you can use with WebBuilder.

https://github.com/stacktracejs/stacktrace.js is the core. Download it, and locate the "dist" folder. Grab the stacktrace.js from there and put it somewhere you can reference it in your project.

Then create another file called callstack.js with this:

function getCallStack(reason)
var callback = function(stackframes) {
   var stringifiedStack = stackframes.map(function(sf) {
       return sf.toString();
//    console.log(reason + stringifiedStack);

//var errback = function(err) { console.log(err.message); };

return reason + ': ' + StackTrace.getSync(); // .then(callback).catch(errback);

Now, I think the first part is redundant - but I hacked it from the examples to get a synchronous result rather than async.

Then in your EWB file, add this in the interface section:

   external function getCallStack(const reason : String): String;

You can then call this to get the stack wherever you want it.

38:06 STACK TElement.UpdateFocus : getCallStack()@https://m3.domain.com/callstack.js:13:35,webui_tdivelement.webui_telement.$p.telement_updatefocus()@https://m3.domain.com/myapp.js:12426:32,webui_tdivelement.webui_telement.$p.handlechanges()@https://m3.domain.com/myapp.js:13412:19,webui_tdivelement.webui_telement.$p.handleupdatechanges()@https://m3.domain.com/myapp.js:13388:10,webui_tdivelement.webui_telement.$p.endupdate()@https://m3.domain.com/myapp.js:14112:13,webui_tdivelement.webui_telement.$p.dochanged()@https://m3.domain.com/myapp.js:13470:13,webui_telements.$p.applychange()@https://m3.domain.com/myapp.js:11190:39,webui_telements.$p.updatetabindexes()@https://m3.domain.com/myapp.js:11409:7


Matthew Jones
Fri, Jun 2 2017 10:32 AMPermanent Link

Mark Brooks



>>"Matthew Jones" wrote:
>>Should you ever need to get a stack trace, for debug purposes only of course, there is a generic JavaScript project >>that you can use with WebBuilder.
>>https://github.com/stacktracejs/stacktrace.js is the core.

Thanks - useful