Skip to content

[JS]General issue: ES6 Analysis Seems Unsupported #20261

@Sp1d3rL1

Description

@Sp1d3rL1

ES6 Analysis Seems Unsupported

When I use:

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

// ... other code ...

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

The following CodeQL cannot track the variable chromium:

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:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions