Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions term_to_binary.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ var Encoder = function() {
// Encode the array as a tuple.
return self.tuple(val);

if((tag === 'pid' || tag === 'p') && valType === 'object')
return self.pid(val);

throw new Error("Unknown tag " + tag.toString() + " for value: " + sys.inspect(val));
}

Expand All @@ -96,6 +99,16 @@ var Encoder = function() {
return result;
}

self.pid = function(x) {
return [
lib.tags.PID,
self.encode(x.node),
lib.uint32(x.id),
lib.uint32(x.serial),
x.creation
];
}

self.buffer = function(x) {
var result = [lib.tags.BINARY];
result.push(lib.uint32(x.length));
Expand Down