Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-17268

TiAPI: Make call stack available through Error.prototype.stack property

    Details

    • Type: New Feature
    • Status: Open
    • Priority: High
    • Resolution: Unresolved
    • Affects Version/s: Release 3.3.0
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None
    • Environment:

      All platforms
      All versions of TItanium

      Description

      problem

      I want to have access to the call stack via the non-standard Error.prototype.stack property. While non-standard, it is available in most browsers and in node.js as well.

      The primary reason for this ticket is that the absence of this property implemented for all platforms causes vague error output with ti-mocha, or any unit testing library that relies on Error.prototype.stack for its stack trace, which is most of them. Aside from this, though, it would just make debugging, testing, and customized error output so much easier.

      test case

      function foo() {
      	function bar() {
      		console.log(new Error().stack);
      	}
      	bar();
      }
      foo();
      

      expected

      In the above test case, I would expect that the complete stack trace would be printed to the console. For example, in node.js, the exact same code would result in the following:

      ≫ node test.js 
      Error
          at bar (/Users/tlukasavage/development/ti-stack/test.js:3:15)
          at foo (/Users/tlukasavage/development/ti-stack/test.js:5:2)
          at Object.<anonymous> (/Users/tlukasavage/development/ti-stack/test.js:7:1)
          at Module._compile (module.js:456:26)
          at Object.Module._extensions..js (module.js:474:10)
          at Module.load (module.js:356:32)
          at Function.Module._load (module.js:312:12)
          at Function.Module.runMain (module.js:497:10)
          at startup (node.js:119:16)
          at node.js:906:3
      

      actual

      The output is null on iOS and Android. I have no tested our other supported platforms.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                tlukasavage Tony Lukasavage
              • Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Integration