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

tests(wpt/console): Enables web platform tests for console #9013

Merged
merged 3 commits into from
Jan 10, 2021

Conversation

tarikeshaq
Copy link
Contributor

@tarikeshaq tarikeshaq commented Jan 5, 2021

A part of #9001

Notes:

  • There are some .html files in the wpt console directory, I ignored those. They seem to be manual tests, anywho just thought I'd note it down.
  • I put TODO(???) on the failing test suites, they seem to have trivial fixes (like the Symbol.toStringTag) but I opted to first get this PR up to see if it's better to file another issue for those (maybe a good first issue 👀 ) or solve the trivial ones here
    Fixes were small enough so I'll add them in a commit here

@CLAassistant
Copy link

CLAassistant commented Jan 5, 2021

CLA assistant check
All committers have signed the CLA.

// The console seems to be the only one that should be writable and non-enumerable
// thus we don't have a unique helper for it. If other properties follow the same
// structure, it might be worth it to define a helper in `util`
windowOrWorkerGlobalScope.console.enumerable = false;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wasn't sure if this is the best place to do this, it seemed to me that non of the existing "util" functions do the desired behavior and since this seemed like a one-off I put it here, open to moving this

runtime/js/02_console.js Outdated Show resolved Hide resolved
@ry ry requested a review from lucacasonato January 7, 2021 14:43
Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

LGTM - thanks @tarikeshaq

@ry ry merged commit 9801858 into denoland:master Jan 10, 2021
@tarikeshaq tarikeshaq deleted the test-wpt-console branch January 10, 2021 18:04
andreubotella pushed a commit to andreubotella/deno that referenced this pull request Sep 11, 2021
A comment in `runtime.js` reads that `console` seems to be "the only one
that should be writable and non-enumerable", which explains why it is
declared with `util.writable` to then have the property descriptor's
`enumerable` key changed to false.

That is not in fact true, and it wasn't even in denoland#9013, when that
behavior was introduced. In fact all WebIDL interfaces are writable and
non-enumerable, declared with `util.nonEnumerable` – the difference here
being that `console` is a namespace / object.

WebIDL, however, treats namespaces and interfaces similarly, and defines
them with the same descriptor keys, so this PR changes the definition of
`console` to use `util.nonEnumerable`.
andreubotella pushed a commit to andreubotella/deno that referenced this pull request Sep 11, 2021
A comment in `runtime.js` reads that `console` seems to be "the only one
that should be writable and non-enumerable", which explains why it is
declared with `util.writable` but then has its property descriptor's
`enumerable` key changed to false.

But it is not in fact true that `console` is the only global property
for which this holds, and it wasn't even when this behavior was
introduced in denoland#9013. All WebIDL interfaces are also writable and
non-enumerable – the only difference here being that `console` is a
namespace rather than an interface.

Since WebIDL interfaces are defined with `util.nonEnumerable`, and
`console` uses the same descriptor keys, this PR changes the definition
of `console` to use `util.nonEnumerable` as well.
bartlomieju pushed a commit that referenced this pull request Sep 11, 2021
A comment in `runtime.js` reads that `console` seems to be "the only one
that should be writable and non-enumerable", which explains why it is
declared with `util.writable` but then has its property descriptor's
`enumerable` key changed to false.

But it is not in fact true that `console` is the only global property
for which this holds, and it wasn't even when this behavior was
introduced in #9013. All WebIDL interfaces are also writable and
non-enumerable – the only difference here being that `console` is a
namespace rather than an interface.

Since WebIDL interfaces are defined with `util.nonEnumerable`, and
`console` uses the same descriptor keys, this PR changes the definition
of `console` to use `util.nonEnumerable` as well.
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.

3 participants