Skip to content

Commit

Permalink
Remove Object.setPrototypeOf polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
Phillip9587 committed Oct 22, 2024
1 parent e162764 commit bcab127
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
5 changes: 5 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
unreleased
========================

* Remove `Object.setPrototypeOf` polyfill

5.0.1 / 2024-10-08
==========

Expand Down
17 changes: 8 additions & 9 deletions lib/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ var merge = require('utils-merge');
var resolve = require('path').resolve;
var once = require('once')
var Router = require('router');
var setPrototypeOf = require('setprototypeof')

/**
* Module variables.
Expand Down Expand Up @@ -117,10 +116,10 @@ app.defaultConfiguration = function defaultConfiguration() {
}

// inherit protos
setPrototypeOf(this.request, parent.request)
setPrototypeOf(this.response, parent.response)
setPrototypeOf(this.engines, parent.engines)
setPrototypeOf(this.settings, parent.settings)
Object.setPrototypeOf(this.request, parent.request)
Object.setPrototypeOf(this.response, parent.response)
Object.setPrototypeOf(this.engines, parent.engines)
Object.setPrototypeOf(this.settings, parent.settings)
});

// setup locals
Expand Down Expand Up @@ -168,8 +167,8 @@ app.handle = function handle(req, res, callback) {
res.req = req;

// alter the prototypes
setPrototypeOf(req, this.request)
setPrototypeOf(res, this.response)
Object.setPrototypeOf(req, this.request)
Object.setPrototypeOf(res, this.response)

// setup locals
if (!res.locals) {
Expand Down Expand Up @@ -232,8 +231,8 @@ app.use = function use(fn) {
router.use(path, function mounted_app(req, res, next) {
var orig = req.app;
fn.handle(req, res, function (err) {
setPrototypeOf(req, orig.request)
setPrototypeOf(res, orig.response)
Object.setPrototypeOf(req, orig.request)
Object.setPrototypeOf(res, orig.response)
next(err);
});
});
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
"safe-buffer": "5.2.1",
"send": "^1.1.0",
"serve-static": "^2.1.0",
"setprototypeof": "1.2.0",
"statuses": "2.0.1",
"type-is": "^2.0.0",
"utils-merge": "1.0.1",
Expand Down

0 comments on commit bcab127

Please sign in to comment.