Skip to content

querystring: avoid conflicts with Object.prototype and __proto__

Rodrigo Muino Tomonari requested to merge github/fork/WebReflection/master into master

Currently, the literal returned object is swallowing all methods and properties inherited from the Object.prototype. This includes the __proto__ special case and this PR aim is to fix all these inherited properties at once, using the in operator before checking the array of known keys.

This PR has been previously described and tested in #5650 and it has been made from scratch to avoid confusion.

The benchmark shows overall 4 out of 5 tests are 2% up to 22% faster and one test, the worst case scenario with many pairs, slower between 3% and 14% than before.

Merge request reports

Loading