skymakerolof / dxf

DXF parser for node/browser
https://www.npmjs.com/package/dxf
MIT License
335 stars 122 forks source link

Don't use object.create. Fixes #130. #132

Closed stevage closed 1 year ago

stevage commented 1 year ago

There's another instance of Object.create() in tables.js that looks suspicious to me, but removing it breaks tests, so I left it.

z3dev commented 1 year ago

The objects.create() is used incorrectly.

Object.create(proto, propertiesObject)

Norice that there are TWO parameters! One is the prototype to copy, i.e. the shape of the object,methods, etc. The other is the values of the properties.

stevage commented 1 year ago

Well, it's not incorrect to not pass a second parameter. But there is just no reason to use Object.create() at all here, as prototypes aren't being used afaik.

skymakerolof commented 1 year ago

Thanks!