dcodeIO/ProtoBuf.js — pull request #61 by gobengo (2013-10-20 21:42:22+00:00)
Title: Fix bug when creating distinct builders for files that import a common file

Fix bug when creating distinct builders for files that import a common file. Builder#files was being shared across all instances.

Builder's constructor now creates a fresh `.files` object for each instance, instead of using a shared object on the prototype.

Also, `.files` used to be an Array, but is now an Object since it was being used as an object like `.files[filename] = true`. All tests still pass, and this also makes debugging easier. Previously, you'd look at `.files` and see an empty array, even if it had `filename` keys set to true.

Added a test, `importDuplicateDifferentBuilder`, that would fail before this change, but no passes.