Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement [LegacyLenientSetter] and test [LegacyLenientThis] #209

Closed

Conversation

ExE-Boss
Copy link
Contributor

@ExE-Boss ExE-Boss commented Apr 22, 2020

This also fixes the bug where [LegacyLenientThis] would still result in attempting to get the implementation value, even when exports.is(esValue) was false, which would result in a TypeError if esValue did not have an implSymbol property.


This will have merge conflicts with #206 and should probably be rebased on top of it, since it doesn’t make sense to have [LegacyLenientThis] use the new naming scheme, but have [LegacyLenientSetter] using the old naming scheme.


Part of #207

Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff, thank you!

test/cases/LegacyLenientAttributes.webidl Show resolved Hide resolved
brandCheck = "";
const replaceable = utils.getExtAttr(this.idl.extAttrs, "Replaceable");
const legacyLenientSetter = utils.getExtAttr(this.idl.extAttrs, "LegacyLenientSetter");
const legacyLenientThis = utils.getExtAttr(this.idl.extAttrs, "LenientThis");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a bonus, can you enforce (via compile-time errors) the following:

An attribute with the [Replaceable] extended attribute must not also be declared with the [LegacyLenientSetter] or [PutForwards] extended attributes.

The [LegacyLenientSetter] extended attribute must take no arguments. It must not be used on anything other than a read only regular attribute.

An attribute with the [LegacyLenientSetter] extended attribute must not also be declared with the [PutForwards] or [Replaceable] extended attributes.

The [LegacyLenientThis] extended attribute must take no arguments. It must not be used on a static attribute.

The [Replaceable] extended attribute must take no arguments.

An attribute with the [Replaceable] extended attribute must not also be declared with the [LegacyLenientSetter] or [PutForwards] extended attributes.

The [Replaceable] extended attribute must not be used on an attribute that is not read only.

The [Replaceable] extended attribute must not be used on a static attribute.

(I've omitted the not-on-a-namespace checks since we don't do namespaces.)

Enforcing these would make it more obvious why we don't have tests for some of these cases.

If you would rather do these in a separate PR, perhaps including checks for all the other extended attributes we implement, that is fine too. Perhaps at that time we could even introduce a way of testing these errors.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I intend to do that in its own PR.

Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Will merge alongside #206, likely this weekend.

@domenic
Copy link
Member

domenic commented Apr 26, 2020

Closing since this is from an organization and we don't accept PRs from organizations anymore. I'll reopen a new PR instead.

@domenic domenic closed this Apr 26, 2020
@ExE-Boss ExE-Boss deleted the feat/ext-attr/legacy-lenient-setter branch April 29, 2020 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants