microsoft / tslib

Runtime library for TypeScript helpers.
BSD Zero Clause License
1.26k stars 128 forks source link

Remove reference to WeakMap from tslib.d.ts #94

Closed rbuckton closed 4 years ago

rbuckton commented 4 years ago

Unfortunately, WeakMap may not be declared when using tslib with a project that has "lib": ["es5"] set.

Fixes: #93

rbuckton commented 4 years ago

I don't see that as an issue since 2.1 is also the first version of TypeScript that supported tslib/--importHelpers: http://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-1.html#support-for-external-helpers-library-tslib

ExE-Boss commented 4 years ago

Would adding the following solve this?

/// <reference lib="es2015.collection"/>

Or would it cause unintended consequences?

HolgerJeromin commented 4 years ago

Would adding the following solve this? /// <reference lib="es2015.collection"/> Or would it cause unintended consequences?

This would pull the collection in every consumer of tslib.d.ts, would it?

DanielRosenwasser commented 4 years ago

/// <reference lib /> doesn't work for older versions. Honestly, tslib isn't meant to be used directly, so even having these types be accurate isn't useful.