tc39 / proposal-extended-numeric-literals

Extensible numeric literals for JavaScript
https://tc39.github.io/proposal-extended-numeric-literals/
72 stars 18 forks source link

Allow some kind of caching, as tagged templates do #5

Closed littledan closed 4 years ago

littledan commented 7 years ago

@dherman raised in TC39, how we could avoid repeated computation in extensible literals. Tagged templates have a mechanism for this--always returning the same object, which you could use as a key in a WeakMap. However, in the current proposal, there is no such object with identity to key off of.

littledan commented 5 years ago

The current specification draft caches by string, as tagged templates originally did, but the caching should be upgraded to cache by location, as they do now.

littledan commented 4 years ago

The current explainer includes a caching mechanism, as have the last few versions. It is analogous to tagged templates.