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

Fix ArrayBuffer cloning (util.clone) #59

Merged
merged 1 commit into from Sep 27, 2011
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions core/shared/Utilities.js
Expand Up @@ -224,10 +224,10 @@ function scrollIntoViewIfNeeded(el) {
} else if (arg instanceof ArrayBuffer) {
// There may be a better way to do this, but I don't know it
var target = new ArrayBuffer(arg.byteLength);
var sourceView = new DataView(arg, 0, source.byteLength);
var targetView = new DataView(target, 0, target.byteLength);
for (var n = 0; n < source.byteLength; n++) {
targetView.setUInt8(n, sourceView.getUInt8(n));
var sourceView = new DataView(arg, 0, arg.byteLength);
var targetView = new DataView(target, 0, arg.byteLength);
for (var n = 0; n < arg.byteLength; n++) {
targetView.setUint8(n, sourceView.getUint8(n));
}
return target;
} else if (util.isTypedArray(arg)) {
Expand Down