Skip to content

javascript: Property access on null or undefined #12722

Open
@ttttmr

Description

@ttttmr

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

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

Is there a generic query that finds all undefined

Metadata

Metadata

Assignees

No one assigned

    Labels

    JSquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions