var assert = require('assert').ok;
-function hOP(obj, prop) {
+// If obj.hasOwnProperty has been overridden, then calling
+// obj.hasOwnProperty(prop) will break.
+// See: https://github.com/joyent/node/issues/1707
+function hasOwnProperty(obj, prop) {
return Object.prototype.hasOwnProperty.call(obj, prop);
}
var packageCache = {};
function readPackage(requestPath) {
- if (hOP(packageCache, requestPath)) {
+ if (hasOwnProperty(packageCache, requestPath)) {
return packageCache[requestPath];
}
var urlDecode = process.binding('http_parser').urlDecode;
-function hOP(obj, prop) {
+// If obj.hasOwnProperty has been overridden, then calling
+// obj.hasOwnProperty(prop) will break.
+// See: https://github.com/joyent/node/issues/1707
+function hasOwnProperty(obj, prop) {
return Object.prototype.hasOwnProperty.call(obj, prop);
}
var k = QueryString.unescape(x[0], true);
var v = QueryString.unescape(x.slice(1).join(eq), true);
- if (!hOP(obj, k)) {
+ if (!hasOwnProperty(obj, k)) {
obj[k] = v;
} else if (!Array.isArray(obj[k])) {
obj[k] = [obj[k], v];
var fs = require('fs');
var rl = require('readline');
-
-function hOP(obj, prop) {
+// If obj.hasOwnProperty has been overridden, then calling
+// obj.hasOwnProperty(prop) will break.
+// See: https://github.com/joyent/node/issues/1707
+function hasOwnProperty(obj, prop) {
return Object.prototype.hasOwnProperty.call(obj, prop);
}
group.sort();
for (var j = 0; j < group.length; j++) {
c = group[j];
- if (!hOP(uniq, c)) {
+ if (!hasOwnProperty(uniq, c)) {
completions.push(c);
uniq[c] = true;
}
[' 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',