github / github/codeql

[JS]General issue: ES6 Analysis Seems Unsupported

Abierto
#20,261 3 comentarios 0 reacciones 0 asignados Ver en GitHub
question
Lenguaje dominante
CodeQL
Estrellas
10.1k
Forks
2.1k
Merge medio
2 d 15 h
PR fusionados (30 d)
141

Descripción

## **ES6 Analysis Seems Unsupported**

When I use:

```javascript
const { chromium } = require('playwright');

// ... other code ...

const newBrowser = await chromium.launch({ headless: true });
```

The following CodeQL cannot track the variable `chromium`:

```ql
SourceNode playwright(TypeTracker t) {
t.start() and
(
result = globalVarRef("chromium")
or
result = moduleImport("playwright")
)
or
exists(TypeTracker t2 |
result = playwright(t2).track(t2, t)
)
}

SourceNode playwright() {
result = playwright(TypeTracker::end())
}

SourceNode playwrightLaunch(TypeTracker t) {
t.start() and
result = playwright().getAMethodCall("launch")
or
exists(TypeTracker t2 |
result = playwrightLaunch(t2).track(t2, t)
)
}

SourceNode playwrightLaunch() {
result = playwrightLaunch(TypeTracker::end())
}
```

However, if it is:

```javascript
const path = require('path');

// ... other code ...

path.join(...);
```

It works!

So, what should I do to track `chromium` in `{chromium}`?

Looking forward to your response.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Start with the provided JavaScript destructuring example and the CodeQL entry points `globalVarRef("chromium")`, `moduleImport("playwright")`, and the `playwright` and `playwrightLaunch` predicates. Compare their behavior with the working `path.join(...)` example; done means the analysis tracks `chromium` from `{ chromium }` through `chromium.launch(...)`.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
javascript
Área
security
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.