Add length.

This commit is contained in:
David Braun 2017-10-18 15:00:15 -04:00
parent 3af150ae49
commit a0a68ab8d1
3 changed files with 14 additions and 1 deletions

View file

@ -254,7 +254,11 @@ const Channel = function(bufferLength = 0) {
}
});
Object.defineProperty(readOnly, `value`, { get: () => lastValue });
Object.defineProperties(readOnly, {
length: { get: () => bufferLength },
value: { get: () => lastValue }
});
Object.freeze(readOnly);
const writeOnly = Object.freeze({