#424 Bundling exception request for nodejs-weak-map
Closed: Fixed None Opened 5 years ago by jamielinux.

Review Request:
https://bugzilla.redhat.com/show_bug.cgi?id=1089494

Upstream project that contains the original WeakMap.js (not currently packaged for Fedora):
https://developers.google.com/caja/

The forked weak-map module for Node.js:
https://github.com/drses/weak-map

This is the single tiny patch that is applied by the forked project:
https://github.com/drses/weak-map/blob/2c87c5a8/sync.patch

This patch allows WeakMap.js to be used by Node.js modules, exporting the appropriate routines. Yes, it's very trivial and is basically a massive copy of the original :( but without this patch, the Node.js modules that require it no longer work at all.

"WeakMap is a collection slated to be introduced to JavaScript with EcmaScript 6. It provides a mapping from objects to values, but allows any entry to be garbage collected if the key is provably lost."

WeakMap() is actually available in Node.js core in versions 0.8/0.10/0.11 already, but it's part of the non-standard Harmony collection (which are enabled by running Node.js with --harmony option). This will not be default in Node.js until it becomes default in V8. It will not become default in V8 until the Harmony standard is finalised (likely not for another year maybe?).

Thus, WeakMap.js is an alternative implementation of Node.js core's WeakMap(), and nodejs-weak-map makes this alternative implementation available for use in Node.js modules and browsers etc.

I would therefore like to request advice on whether it would be possible to temporarily bundle this until the Harmony standard is finalised and Node.js includes the Harmony collection by default. (Two of my packages that are currently part of Fedora and EPEL cannot be updated to the latest release without nodejs-weak-map.)


Bundling request approved (+1:5, 0:0, -1:0). Must be unbundled when Harmony standard is finalized and code is available in Node.js core.

Login to comment on this ticket.

Metadata