github / github/codeql

[JS]General issue: ES6 Analysis Seems Unsupported

Đang mở
#20,261 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
question
Ngôn ngữ chính
CodeQL
Star
10.1k
Fork
2.1k
Merge trung bình
2 ngày 15 giờ
Pull request đã merge (30 ngày)
141

Mô tả

## **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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.