question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Settings includes values on Object.prototype

See original GitHub issue

App settings pull from Object.prototype if they’re missing on the settings object.

const app = require('express')();

app.get('hasOwnProperty');
// => [Function: hasOwnProperty]

app.enabled('hasOwnProperty');
// => true

Is this intentional? If not, I’m happy to help fix.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

5reactions
dougwilsoncommented, Feb 3, 2022

It sounds good, though I don’t think you can just ignore any inherited value – that is how the settings are inherited from parent apps to sub apps.

1reaction
dougwilsoncommented, Feb 3, 2022

Likely good enough to just filter out if it in Object.prototype.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Object prototypes - Learn web development | MDN
Prototypes are the mechanism by which JavaScript objects inherit features from one another. In this article, we explain what a prototype is, how ......
Read more >
Proper way of setting fields in JavaScript using object prototype
As I wrote in the comment, I set each variables with the corresponding prototype 's value. In that way, if you do: alert(new...
Read more >
Prototype methods, objects without __proto__
Setting or reading the prototype with obj. ... The prototype property of a constructor function has worked since very ancient times.
Read more >
JavaScript Object Prototypes - W3Schools
All JavaScript objects inherit properties and methods from a prototype. In the previous chapter we learned how to use an object constructor: Example....
Read more >
Understanding the prototype property in JavaScript - byte archer
The value holding the prototype of an object is sometimes called the internal prototype link. It's also been historically called __proto__, a name...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found