Skip to content

Commit

Permalink
Support typed arrays with custom parents
Browse files Browse the repository at this point in the history
Typed arrays (Uint8Array, etc.) can point to a slice of a larger
backing ArrayBuffer.

Currently, Rusha is broken because it just uses the whole backing
ArrayBuffer disregarding the slice that the typed array points to.

This PR resolves this issue.
  • Loading branch information
feross committed Jan 8, 2015
1 parent f379c43 commit ee12d93
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rusha.sweet.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
case 'array': return convBuf.bind(data);
case 'buffer': return convBuf.bind(data);
case 'arraybuffer': return convBuf.bind(new Uint8Array(data));
case 'view': return convBuf.bind(new Uint8Array(data.buffer));
case 'view': return convBuf.bind(new Uint8Array(data.buffer, data.byteOffset, data.byteLength));
case 'blob': return convBlob.bind(data);
}
};
Expand Down

0 comments on commit ee12d93

Please sign in to comment.