Skip to content

Check for whether an error is internal needs updating for ES6 classes #6172

@davepagurek

Description

@davepagurek

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build Process
  • Unit Testing
  • Internalization
  • Friendly Errors
  • Other (specify if possible)

p5.js version

main branch

Web browser and version

Firefox 108.0

Operating System

macOS 12.5.1

Steps to reproduce this

In #6088 we noticed that errors thrown from within a p5 class aren't registered as being internal from FES. This seems to be because the source name in the stacktrace look different when inside an ES6 class and do not include the class name.

e.g. before: (source includes _main.default.Element.prototype)
image

after: (source does not include the class)
image

We may need to either update our babel configuration to output the same code structure as before, or update the way we check if an error is internal, which currently happens here:

if (stacktrace[j].functionName.search('_main.default') !== -1) {

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions