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

Remove WeakMap/WeakSet#clear method #6500

Closed
falsandtru opened this issue Jan 15, 2016 · 3 comments
Closed

Remove WeakMap/WeakSet#clear method #6500

falsandtru opened this issue Jan 15, 2016 · 3 comments
Labels
Breaking Change Would introduce errors in existing code 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 Good First Issue Well scoped, documented and has the green light Help Wanted You can do this

Comments

@falsandtru
Copy link
Contributor

changes:

// lib.es6.d.ts and lib.core.es6.d.ts
// also WeakSet
 interface WeakMap<K, V> {
-    clear(): void;
     delete(key: K): boolean;
     get(key: K): V;
     has(key: K): boolean;
     set(key: K, value?: V): WeakMap<K, V>;
     [Symbol.toStringTag]: "WeakMap";
 }

https://tc39.github.io/ecma262/#sec-weakmap-constructor
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap
https://bugzilla.mozilla.org/show_bug.cgi?id=1101817

@RyanCavanaugh RyanCavanaugh added Bug A bug in TypeScript Help Wanted You can do this Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript labels Jan 15, 2016
@mhegazy mhegazy added the Breaking Change Would introduce errors in existing code label Jan 17, 2016
@LPGhatguy
Copy link
Contributor

What runtime environments have this implemented?

I did a quick test against the latest Chrome, Node.js, and Edge and none of them had WeakSet.prototype.clear or WeakMap.prototype.clear defined as far as I could tell.

@mhegazy
Copy link
Contributor

mhegazy commented Jan 19, 2016

@LPGhatguy it needs to be removed. it was part of the spec at an earlier draft but has since been removed.

@mhegazy mhegazy added this to the Community milestone Jan 19, 2016
@DanielRosenwasser DanielRosenwasser added the Good First Issue Well scoped, documented and has the green light label Jan 19, 2016
@DanielRosenwasser
Copy link
Member

Thanks @falsandtru!

@DanielRosenwasser DanielRosenwasser added the Fixed A PR has been merged for this issue label Jan 24, 2016
@mhegazy mhegazy modified the milestones: TypeScript 1.8, Community Jan 25, 2016
zhengbli added a commit to zhengbli/TypeScript that referenced this issue Sep 6, 2016
zhengbli added a commit that referenced this issue Sep 6, 2016
zhengbli added a commit that referenced this issue Sep 6, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Breaking Change Would introduce errors in existing code 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 Good First Issue Well scoped, documented and has the green light Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

5 participants