stacktracejs/stackframe

Create a StackFrame from an object

micky2be opened this issue · 1 comments

When passing a StackFrame from my client to my server I json stringify it.
So from the server I'll like to be able to recreate the StackFrame just by assigning the object received.

{
    functionName: "WuiDom.eval",
    fileName: "src/views/LoginScreen/index.js",
    lineNumber: 233,
    columnNumber: 17,
    source: "    at WuiDom.eval (src/views/LoginScreen/index.js:233:17)"
}

I generally like this idea. We have to be careful how we handle construction. Source map consumer objects have similar but not identical keys, and I don't want users to be confused if they pass {line: 42} and get null back.

Being explicit, though verbose, may be preferable. I'm open to suggestions here.