mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
Fix #1707 hasOwnProperty usage
If hasOwnProperty is overridden, then calling `obj.hasOwnProperty(prop)` can fail. Any time a dictionary of user-generated items is built, we cannot rely on hasOwnProperty being safe, so must call it from the Object.prototype explicitly.
This commit is contained in:
1 parent
b3af074a02
commit
e06ce7562c
4 files changed
+16
-7
No files matched your search
@@ -49,6 +49,7 @@ var qsTestCases = [
|
||||
[' foo = bar ', '%20foo%20=%20bar%20', {' foo ': ' bar '}],
|
||||
['foo=%zx', 'foo=%25zx', {'foo': '%zx'}],
|
||||
['foo=%EF%BF%BD', 'foo=%EF%BF%BD', {'foo': '\ufffd' }],
|
||||
// See: https://github.com/joyent/node/issues/1707
|
||||
[ 'hasOwnProperty=x&toString=foo&valueOf=bar&__defineGetter__=baz',
|
||||
'hasOwnProperty=x&toString=foo&valueOf=bar&__defineGetter__=baz',
|
||||
{ hasOwnProperty: 'x',
|
||||
|
||||
Reference in new issue
Block a user