8000 fix: Do not inherit app object from Object prototype (#1153) · feathersjs/feathers@ed8c2e4 · GitHub 8000
[go: up one dir, main page]

Skip to content

Commit ed8c2e4

Browse files
authored
fix: Do not inherit app object from Object prototype (#1153)
1 parent 8e129d8 commit ed8c2e4

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@ node_modules
3434

3535
# Distributables
3636
dist/
37+
.nyc_output/

packages/feathers/lib/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@ const Proto = require('uberproto');
33
const Application = require('./application');
44
const version = require('./version');
55
const { ACTIVATE_HOOKS, activateHooks } = require('./hooks');
6+
// A base object Prototype that does not inherit from a
7+
// potentially polluted Object prototype
8+
const baseObject = Object.create(null);
69

710
function createApplication () {
8-
const app = {};
11+
const app = Object.create(baseObject);
912

1013
// Mix in the base application
1114
Proto.mixin(Application, app);

0 commit comments

Comments
 (0)
0