Skip to content

DOMTokenList missing replace() function #22466

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

Closed
lenovouser opened this issue Mar 10, 2018 · 4 comments
Closed

DOMTokenList missing replace() function #22466

lenovouser opened this issue Mar 10, 2018 · 4 comments
Assignees
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Fixed A PR has been merged for this issue Help Wanted You can do this

Comments

@lenovouser
Copy link

https://github.com/Microsoft/TypeScript/blob/be1c11581e43098bcb6747af50f43b39c762be39/src/lib/dom.generated.d.ts#L3282-L3291

Code

const span    = document.querySelector("span");
const classes = span.classList;

try {
    classes.replace("orange", "apple");
    span.textContent = classes.toString();
} catch(e) {
    span.textContent = e;
}

Playground Link: typescriptlang.org/play

@bcherny
Copy link

bcherny commented Mar 10, 2018

@lenovouser
Copy link
Author

lenovouser commented Mar 11, 2018

@bcherny ah okay, thought the lib*.d.ts files were still generated from the Edge sources. Will do! 👍

@bcherny
Copy link

bcherny commented Mar 11, 2018

@lenovouser What "edge sources"? My suggestion might be wrong - I assumed they're hand-written.

@lenovouser
Copy link
Author

@bcherny no you're right. Last time I checked the lib.dom.d.ts files were still generated from the Edge sources here github.com/microsoft/ts-lib-generator but it seems like they now have two files, one lib.dom.d.ts and dom.generated.d.ts

@mhegazy mhegazy added Fixed in TSJS repo Fix merged in https://github.com/Microsoft/TSJS-lib-generator, but not ported yet Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Bug A bug in TypeScript Help Wanted You can do this labels Mar 23, 2018
@mhegazy mhegazy self-assigned this Mar 23, 2018
@mhegazy mhegazy added this to the TypeScript 2.9 milestone Mar 23, 2018
@mhegazy mhegazy reopened this Mar 23, 2018
@mhegazy mhegazy modified the milestones: TypeScript 2.9, TypeScript 2.8.2 Mar 28, 2018
@mhegazy mhegazy added Fixed A PR has been merged for this issue and removed Fixed in TSJS repo Fix merged in https://github.com/Microsoft/TSJS-lib-generator, but not ported yet labels Mar 28, 2018
@microsoft microsoft locked and limited conversation to collaborators Jul 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Fixed A PR has been merged for this issue Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

3 participants