github / github/codeql

javascript: Property access on null or undefined

オープン
#12,722 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
JS question
主要言語
CodeQL
スター
10.1k
フォーク
2.1k
平均マージ
2日 15時間
マージ済み PR(30日)
141

説明

I refer to this document
https://codeql.github.com/codeql-query-help/javascript/js-property-access-on-non-object/

I hope to find these `undefined`
```js
window.name // ok
window.abc // undefined
some // undefined

window.a=1
window.a // ok

let obj = {
k1: 1,
}
obj.k1 // ok
obj.k2 // undefined
obj.toString // ok
obj.length // undefined

let arr = []
arr.toString // ok
arr.length // ok
arr.hello // undefined

document.body // ok
document.asd // undefined

location.pathname // ok
location.path // undefined
```

But I didn't find anything
![image](https://user-images.githubusercontent.com/32825326/229015805-ca0494d2-883d-48b4-81f9-ae44ce00b8de.png)

Is there a generic query that finds all `undefined`

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。