Git Product home page Git Product logo

Comments (7)

oliversalzburg avatar oliversalzburg commented on September 23, 2024

I'm not quite following. Are you referring to lineNumber and columnNumber? How are the properties creating problems?

I don't think the names were chosen to indicate the type of the variable, but I'm definitely not opposed to changing the names, if they cause a problem.

from stackframe.

capaj avatar capaj commented on September 23, 2024

@oliversalzburg yes, those two properties are exactly what I was referring to. It's not a problem, as much as it is inconvenient.
It would be easier to use with mozilla's project if the property names would just line and column

from stackframe.

oliversalzburg avatar oliversalzburg commented on September 23, 2024

@eriwen What's your take on this?

This would be a breaking change, as dependent projects could be referencing the lineNumber and columnNumber properties.

@capaj Would convenience getters that map line to lineNumber and column to columnNumber also be a valid solution?

from stackframe.

capaj avatar capaj commented on September 23, 2024

@oliversalzburg getters would solve it for me.
I would also be okay with waiting until the next major version. Whichever you prefer.

from stackframe.

oliversalzburg avatar oliversalzburg commented on September 23, 2024

@capaj Just to make sure, I assume your use case isn't covered by stacktrace-gps?

from stackframe.

capaj avatar capaj commented on September 23, 2024

@oliversalzburg I am actually using it to get the actual line/column of a location where error was thrown. I will probably use it-it does exactly what I need. Once I figure out how to get source maps out of SystemJS

from stackframe.

eriwen avatar eriwen commented on September 23, 2024

The property names are intended to be as similar to Gecko and V8 Error stack representations.

A getter would work, but stackframe is intended for use even in browsers that don't support ES5 getters. We could provide that and a polyfill, but that would significantly impact the library size.

We could perhaps add aliases such that line and column retrieve those values if this especially painful for some reason. I understand this makes the code a little more verbose but this is in the interest of consistency and clarity.

from stackframe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.