Object.prototype
builtins should not be used directly JS-0021 1062 ? a(o)
1063 : 1 < a.length
1064 ? ((t = [e, e, "", o]),
1065 b.setFilters.hasOwnProperty(e.toLowerCase()) 1066 ? le(function (e, t) {
1067 var n,
1068 r = a(e, o),
1062 ? a(o)
1063 : 1 < a.length
1064 ? ((t = [e, e, "", o]),
1065 b.setFilters.hasOwnProperty(e.toLowerCase()) 1066 ? le(function (e, t) {
1067 var n,
1068 r = a(e, o),
1062 ? a(o)
1063 : 1 < a.length
1064 ? ((t = [e, e, "", o]),
1065 b.setFilters.hasOwnProperty(e.toLowerCase()) 1066 ? le(function (e, t) {
1067 var n,
1068 r = a(e, o),
1062 ? a(o)
1063 : 1 < a.length
1064 ? ((t = [e, e, "", o]),
1065 b.setFilters.hasOwnProperty(e.toLowerCase()) 1066 ? le(function (e, t) {
1067 var n,
1068 r = a(e, o),
10862 l.extraData.hasOwnProperty(n) &&
10863 (q.isPlainObject(l.extraData[n]) &&
10864 l.extraData[n].hasOwnProperty("name") &&
10865 l.extraData[n].hasOwnProperty("value")10866 ? a.push(
10867 q(
10868 '<input type="hidden" name="' +
It is preferable to call certain Object.prototype
methods through Object
on object instances instead of using the builtins directly.
Objects can have properties that shadow the builtins on Object.prototype
, potentially causing unintended behavior or denial-of-service security vulnerabilities.
For example, it would be unsafe for a webserver to parse JSON input from a client and call hasOwnProperty
directly on the resulting object, because a malicious client could send a JSON value like {"hasOwnProperty": 1}
and cause the server to crash.
It's better to always call these methods from Object.prototype
. For example, obj.hasOwnProperty("bar")
should be replaced with Object.prototype.hasOwnProperty.call(obj, "bar")
.
let hasBarProperty = obj.hasOwnProperty("property");
let isPrototypeOfBar = obj.isPrototypeOf(property);
let barIsEnumerable = obj.propertyIsEnumerable("property");
let hasBarProperty = Object.prototype.hasOwnProperty.call(obj, "property");
let isPrototypeOfBar = Object.prototype.isPrototypeOf.call(obj, property);
let barIsEnumerable = {}.propertyIsEnumerable.call(obj, "property");