JavaScript externs model StorageEvent() with no type argument
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 84/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript
調査の方向性
javascript/externs/web/webstorage.js から始め、StorageEvent コンストラクターと initStorageEvent の宣言を、issue に記載されている現在の Web IDL と比較します。文書化された型と省略可能な引数が表現されるように extern シグネチャを更新し、その後、示されている有効なコンストラクターの使用法がゼロ引数としてモデル化されなくなったことを確認します。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- CodeQL
- スター
- 10.1k
- フォーク
- 2.1k
- 平均マージ
- 2日 11時間
- マージ済み PR(30日)
- 129
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
github/codeql のほかの issue
-
C#: cs/simplifiable-boolean-expression false positive on Nullable<bool> compared with a literal オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
false-positive
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
false-positive
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
danielmiessler/LifeOS#2218 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
hemilabs/ui-monorepo#2332 ·
-
Help-Wanted Needs-Triage Package-Update
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
microsoft/winget-pkgs#438662 ·
-
priority: p3
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
googleapis/librarian#7636 ·