Closed
Description
QueryString has a comment that states the following,
// replaces encodeURIComponent
// http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3.4
However, the spec states that you should use ToString
. In the code, you’re using ValueOf
. I.e.
const x = { valueOf: function() { return 'other result'; }, toString: function() { return 'spec result'; } }
encodeURIComponent(x) !== require('querystring').escape(x)