Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore inherited properties when iterating through flags #255

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
10 changes: 6 additions & 4 deletions lib/protocol/framer.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,12 @@ Serializer.commonHeader = function writeCommonHeader(frame, buffers) {

var flagByte = 0;
for (var flag in frame.flags) {
var position = frameFlags[frame.type].indexOf(flag);
assert(position !== -1, 'Unknown flag for frame type ' + frame.type + ': ' + flag);
if (frame.flags[flag]) {
flagByte |= (1 << position);
if (frame.flags.hasOwnProperty(flag)) {
var position = frameFlags[frame.type].indexOf(flag);
assert(position !== -1, 'Unknown flag for frame type ' + frame.type + ': ' + flag);
if (frame.flags[flag]) {
flagByte |= (1 << position);
}
}
}
headerBuffer.writeUInt8(flagByte, 4);
Expand Down