Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when plain object in a value #33

Closed
dougwilson opened this issue Aug 29, 2014 · 1 comment · Fixed by #34
Closed

Error when plain object in a value #33

dougwilson opened this issue Aug 29, 2014 · 1 comment · Fixed by #34
Assignees
Labels
Milestone

Comments

@dougwilson
Copy link
Contributor

brief reproduction (from expressjs/connect-multiparty#11 (comment)):

$ node -pe 'o=Object.create(null);o.r=4;require("qs").parse({"a": o})'

node_modules\qs\lib\utils.js:47
        if (source.hasOwnProperty(i)) {
                   ^
TypeError: Object object has no method 'hasOwnProperty'
    at Object.exports.clone (node_modules\qs\lib\utils.js:47:20)
    at Object.exports.clone (node_modules\qs\lib\utils.js:48:31)
    at Object.module.exports [as parse] (node_modules\qs\lib\parse.js:141:89)
    at [eval]:1:43
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:456:26)
    at evalScript (node.js:536:25)
    at startup (node.js:80:7)
    at node.js:906:3
@dougwilson
Copy link
Contributor Author

and for posterity:

$ npm install qs@0.6.6
qs@0.6.6 node_modules\qs
$ node -pe 'o=Object.create(null);o.r=4;require("qs").parse({"a": o})'
{ a: { r: 4 } }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants