JavaScript externs model StorageEvent() with no type argument
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript
Research direction
Start in javascript/externs/web/webstorage.js and compare the StorageEvent constructor and initStorageEvent declarations with the current Web IDL described in the issue. Update the extern signatures so the documented type and optional arguments are represented, then verify that the shown valid constructor usage is no longer modeled as zero-argument.
Written by the indexing model from the issue text.
Description
Description
javascript/externs/web/webstorage.js still models StorageEvent as a zero-argument constructor:
/**
* @see http://www.w3.org/TR/2011/CR-webstorage-20111208/#the-storage-event
* @extends {Event}
* @constructor
*/
function StorageEvent() {}
Current HTML (the-storageevent-interface) defines:
constructor(DOMString type, optional StorageEventInit eventInitDict = {});
new StorageEvent('storage', { key, newValue, ... }) is valid in browsers (constructor available since 2018). CodeQL 2.27.0 reported a false positive on a standards-conforming new StorageEvent('storage', { ... }) call used in a synthetic StorageEvent test.
initStorageEvent in the same file also follows the old required-argument list; the spec method has optional arguments after type.
I searched this tracker for StorageEvent / StorageEventInit / webstorage externs and did not find an existing issue.
Reproduction
- Analyze JavaScript that constructs
new StorageEvent('storage', { key: 'k', newValue: 'v' }). - Observe a CodeQL alert that treats the constructor as taking no parameters.
Expected
Externs should match the current constructor (type plus optional StorageEventInit) so valid Web IDL usage is not flagged.
This is a modeling/false-positive report only. No exploit is claimed.
- Dominant language
- CodeQL
- Stars
- 10.1k
- Forks
- 2.1k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 129
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from github/codeql
-
C#: cs/simplifiable-boolean-expression false positive on Nullable<bool> compared with a literal Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
false-positive
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
false-positive
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
hemilabs/ui-monorepo#2332 ·
-
Help-Wanted Needs-Triage Package-Update
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
microsoft/winget-pkgs#438662 ·
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
olcf/olcf-test-harness#278 · 1 comment ·