[walker] Allow custom fields to be added to new walkers

Issue #13
This commit is contained in:
Marijn Haverbeke
2012-11-08 21:07:31 +01:00
parent cb6cd3038e
commit f91d7f5836

View File

@@ -46,8 +46,8 @@
exports.make = function(funcs, base) {
if (!base) base = exports;
var visitor = {};
for (var type in base)
visitor[type] = funcs.hasOwnProperty(type) ? funcs[type] : base[type];
for (var type in base) visitor[type] = base[type];
for (var type in funcs) visitor[type] = funcs[type];
return visitor;
};