Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with firefox ? #14

Closed
Poil opened this issue Jan 27, 2015 · 1 comment
Closed

Not working with firefox ? #14

Poil opened this issue Jan 27, 2015 · 1 comment
Assignees
Labels

Comments

@Poil
Copy link

Poil commented Jan 27, 2015

Hi,

I've opened a but on puppetexplorer but it seem the bug came from your module (I'm a noob in nodejs so perhaps I'm totally wrong)

I've got this error in Firefox "TypeError: Error.captureStackTrace is not a function"

If you check other nodejs module you have acode like this

  if (Error.captureStackTrace) {
    Error.captureStackTrace(this, stackStartFunction);
  }
  else {
    // non v8 browsers so we can have a stacktrace
    var err = new Error();
    if (err.stack) {
      var out = err.stack;

      // try to strip useless frames
      var fn_name = stackStartFunction.name;
      var idx = out.indexOf('\n' + fn_name);
      if (idx >= 0) {
        // once we have located the function frame
        // we need to strip out everything before it (and its line)
        var next_line = out.indexOf('\n', idx + 1);
        out = out.substring(next_line + 1);
      }

      this.stack = out;
    }
  }
@dougwilson
Copy link
Owner

Hi! This is a Node.js module; it is not intended to function within web browsers. According to your stack from the other issue, the ast-types module, if it intends to function within a web browser, should define a fallback for it's dependency on this module when used within things like browserify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants