Skip to content

Throw behaviour of calling setter without argument #2075

@shannonbooth

Description

@shannonbooth

WPT https://github.com/web-platform-tests/wpt/blob/9b1f66c6fa9f6bc4e9abe3346d4069be7964b10e/wasm/jsapi/global/value-get-set.any.js#L135

Tests that calling a setter without any arguments should throw a TypeError, which all browsers implement. This might be me missing it - but this does not seem to be specified anywhere.

The getter in question is defined in IDL: https://webassembly.github.io/spec/js-api/#global

IDL attribute setter defines the steps such that undefined should be passed rather than throwing:

1. Let V be undefined.
2. If any arguments were passed, then set V to the value of the first argument passed.

And https://webassembly.github.io/spec/js-api/#dom-global-value does not seem like it should result in a throw in this scenario.

Maybe the getter in the spec needs to be special cased for this scenario?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions