blob: 110631b9394700407a8eb895f66e83801e9f4ceb [file] [log] [blame]
A TypeError with sensible message should be thrown for a primitive EventListener that is neither null nor undefined
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS () => { (new EventTarget).addEventListener("foo", null); } did not throw exception.
PASS () => { matchMedia("").removeListener(undefined); } did not throw exception.
PASS () => { (new EventTarget).addEventListener("foo", 1); } threw exception TypeError: Argument 2 ('listener') to EventTarget.addEventListener must be an object.
PASS () => { (new EventTarget).removeEventListener("foo", false); } threw exception TypeError: Argument 2 ('listener') to EventTarget.removeEventListener must be an object.
PASS () => { matchMedia("").addListener(Symbol()); } threw exception TypeError: Argument 1 ('listener') to MediaQueryList.addListener must be an object.
PASS () => { matchMedia("").removeListener("bar"); } threw exception TypeError: Argument 1 ('listener') to MediaQueryList.removeListener must be an object.
PASS successfullyParsed is true
TEST COMPLETE