Skip to content

printStackTrace throws exception when called from "use strict" code #47

@jphaas

Description

@jphaas

In strict mode, use of argument.caller throws an exception. This means that if there is strict mode code anywhere in the call stack, printStackTrace fails. Here's a jsfiddle that illustrates this: http://jsfiddle.net/SVN4D/ (I'm passing an integer as the error object to force IE-style stacktrace generation, since the implementation for webkit et al doesn't rely on argument.caller).

Instead of throwing an exception, I think it would make more sense to return as much of the call stack as we can, and then have the last entry in the array be something like 'error: cannot read strict mode stacktraces for this browser' or something.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions