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

Bug: doesn't initialize from an object with null prototype #18

Closed
caub opened this issue Feb 13, 2019 · 1 comment
Closed

Bug: doesn't initialize from an object with null prototype #18

caub opened this issue Feb 13, 2019 · 1 comment
Assignees

Comments

@caub
Copy link
Contributor

caub commented Feb 13, 2019

StackFrame constructor doesn't accept object with null prototype:

> const StackFrame = require('stackframe');
undefined
> new StackFrame({fileName:'lol'})
{ fileName: 'lol' }
> new StackFrame(Object.assign(Object.create(null),{fileName:'lol'}))
{}
> new StackFrame('lol'.match(/(?<fileName>\w+)/).groups)
{}
$ npm ls stackframe
├── stackframe@1.0.4 
└─┬ stacktrace-gps@3.0.2
  └── stackframe@1.0.4  deduped
@devsnek
Copy link

devsnek commented Feb 13, 2019

issue is obj instanceof Object, which is... a weird way to test for objects, to say the least. it also uses obj.hasOwnProperty lower down which will cause issues when the first part is fixed.

caub added a commit to caub/stackframe that referenced this issue Feb 13, 2019
caub added a commit to caub/stackframe that referenced this issue Feb 20, 2019
caub added a commit to caub/stackframe that referenced this issue Feb 20, 2019
caub added a commit to caub/stackframe that referenced this issue Feb 20, 2019
@eriwen eriwen self-assigned this Sep 14, 2019
@eriwen eriwen mentioned this issue Sep 14, 2019
@eriwen eriwen closed this as completed in 147b7a5 Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants