Function Prototype Shadowing problems due to no guarding of 'reserved' property names · Issue #795 · node-config/node-config · GitHub
Skip to content

Function Prototype Shadowing problems due to no guarding of 'reserved' property names #795

Description

@jdmarshall

I used node-config for far too long before I discovered https://github.com/node-config/node-config/wiki/Reserved-Words

I even issued a PR (#705) meant to override it.

I ended up writing my own linter for the config/directory that checked for things like this. A utility method callable by users to do the same would be quite handy to have. Perhaps even a CLI to check things like this.

Part of the failure mode here is that because of the way setImmutable and defineProperty works, there's a silent failure mode when the definition collision happens. For certain combination of property attributes, further attempts to modify the object simply become a no-op, with no exception. The changes I made in #705 were meant to address that but I now think in the wrong direction.

There may be a few lines of that PR that still should be brought forward, as IMO there are two bugs there.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions