0

The following javascript code prints "stack is undefined" on iOS 6.1 / Xcode 5 using Cordova 3.4, but it works fine (prints nothing) using Cordova on Android. It also works fine in a web browser. What's so different about iOS?

if (typeof new Error().stack == 'undefined') {
    console.log("stack is undefined.");
}

What gives?

Michael Galaxy
  • 1,213
  • 14
  • 17

1 Answers1

1

Unfortunately, Error.stack is a non-standard property and may not be present in all browsers. It appears they did not write it into Cordova on iOS.

Mike Cluck
  • 31,869
  • 13
  • 80
  • 91