updated javascript for in snippet (#111062)
Updated javascript for in snippet to use Object.hasOwnProperty insted of object.hasOwnProperty because of this vulnerability: https://eslint.org/docs/rules/no-prototype-builtins
This commit is contained in:
parent
9195c9ab14
commit
2b75c3d5ac
|
@ -35,7 +35,7 @@
|
|||
"prefix": "forin",
|
||||
"body": [
|
||||
"for (const ${1:key} in ${2:object}) {",
|
||||
"\tif (${2:object}.hasOwnProperty(${1:key})) {",
|
||||
"\tif (Object.hasOwnProperty.call(${2:object}, ${1:key})) {",
|
||||
"\t\tconst ${3:element} = ${2:object}[${1:key}];",
|
||||
"\t\t$0",
|
||||
"\t}",
|
||||
|
|
Loading…
Reference in a new issue