Skip to content

Add generic support to Element.closest() #697

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

Merged
merged 3 commits into from
Jun 4, 2019
Merged

Add generic support to Element.closest() #697

merged 3 commits into from
Jun 4, 2019

Conversation

fregante
Copy link

This now matches querySelector. Allows:

element.closest<HTMLAnchorElement>('.lol')
// => HTMLAnchorElement

@fregante
Copy link
Author

I have no idea of what the error means 😮

@HolgerJeromin
Copy link
Contributor

You have to run the script and include the generated files, too. You submitted only the input files.
Not sure about the error we see.

@fregante
Copy link
Author

fregante commented Apr 19, 2019

Edit: resolved

Master fails too, npm run fetch/build shows the same message

./TSJS-lib-generator master
❯ nr fetch

> tsjs-lib-generator@ fetch ./TSJS-lib-generator
> echo This could take a few minutes... && npm run fetch-idl && npm run fetch-mdn

This could take a few minutes...

> tsjs-lib-generator@ fetch-idl ./TSJS-lib-generator
> tsc --p ./tsconfig.json && node ./lib/idlfetcher.js

src/widlprocess.ts:199:5 - error TS2326: Types of property 'name' are incompatible.
  Type 'string | null' is not assignable to type 'string | undefined'.
    Type 'null' is not assignable to type 'string | undefined'.

199     return {
        ~~~~~~~~
200         name: operation.name,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
... 
208         exposed: getExtAttrConcatenated(operation.extAttrs, "Exposed") || inheritedExposure
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
209     };
    ~~~~~~


Found 1 error.

Same error currently in #696

@saschanaz
Copy link
Contributor

No need to npm run fetch here, try running npm run build && npm run baseline-accept after you apply #696 (comment).

@msftclas
Copy link

msftclas commented Apr 20, 2019

CLA assistant check
All CLA requirements met.

@fregante
Copy link
Author

All good now

@sandersn sandersn merged commit 7851d16 into microsoft:master Jun 4, 2019
@fregante fregante deleted the patch-1 branch June 5, 2019 03:09
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.

5 participants