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

file.href #1113

Merged
merged 2 commits into from Mar 21, 2024
Merged

file.href #1113

merged 2 commits into from Mar 21, 2024

Conversation

mbostock
Copy link
Member

Fixes #954.

@mbostock mbostock requested a review from Fil March 20, 2024 00:52
@Fil
Copy link
Contributor

Fil commented Mar 20, 2024

Would it be useful to make this discoverable in the inspector?

For example by adding a getter to FileAttachmentImpl:

  get href() {
    return this.href;
  }

Capture d’écran 2024-03-20 à 08 59 51

(it would also be nice to hide the deprecated url() method, but I don't know how to do that.)

@mbostock
Copy link
Member Author

If we want the file.href to be discoverable, we simply make it enumerable here:

    Object.defineProperty(this, "href", {value: href, enumerable: true});

I chose not to do that because I think it’s extra noise, but let me take a look and see what I think.

@mbostock mbostock enabled auto-merge (squash) March 21, 2024 23:25
@mbostock mbostock merged commit 311cd58 into main Mar 21, 2024
4 checks passed
@mbostock mbostock deleted the mbostock/file-href branch March 21, 2024 23:27
@mbostock mbostock mentioned this pull request Mar 22, 2024
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.

Make FileAttachment.url synchronous
2 participants