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.
Description
javascript/externs/web/webstorage.jsstill modelsStorageEventas a zero-argument constructor: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-conformingnew StorageEvent('storage', { ... })call used in a syntheticStorageEventtest.initStorageEventin the same file also follows the old required-argument list; the spec method has optional arguments aftertype.I searched this tracker for StorageEvent / StorageEventInit / webstorage externs and did not find an existing issue.
Reproduction
new StorageEvent('storage', { key: 'k', newValue: 'v' }).Expected
Externs should match the current constructor (
typeplus optionalStorageEventInit) so valid Web IDL usage is not flagged.This is a modeling/false-positive report only. No exploit is claimed.