Closed Bug 1770452 Opened 3 months ago Closed 3 months ago

[wpt-sync] Sync PR 34146 - Add test to confirm calling Request constructor without `new` throws an error

Categories

(Core :: DOM: Networking, task, P4)

task

Tracking

()

RESOLVED FIXED
102 Branch
Tracking Status
firefox102 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 34146 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/34146
Details from upstream follow.

Jake Champion <me@jakechampion.name> wrote:

Add test to confirm calling Request constructor without new throws an error

The Request interface defines a Web IDL constructor and the Web IDL constructor definition states:

If the interface is declared with a constructor operation, then the interface object can be called as a constructor to create an object that implements that interface. Calling that interface as a function will throw an exception.
https://webidl.spec.whatwg.org/#interface-object

This commit adds a test to ensure that calling Request as a function will throw an exception.

I couldn't find an already existing test case for this, which is why I have created this pull-request.
If this test case addition is correct, I can add test cases for other interfaces which are missing this type of test case

Component: web-platform-tests → DOM: Networking
Product: Testing → Core

CI Results

Ran 11 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 4 tests and 22 subtests

Status Summary

Firefox

OK : 4
PASS: 84
FAIL: 4

Chrome

OK : 4
PASS: 84
FAIL: 4

Safari

OK : 4
PASS: 88

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2696b81b9666
[wpt PR 34146] - Add test to confirm calling Request constructor without `new` throws an error, a=testonly
Status: NEW → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 102 Branch
You need to log in before you can comment on or make changes to this bug.