Skip to content

Commit

Permalink
Fix "ReferenceError: 'ArrayBuffer' is undefined" when initializing a …
Browse files Browse the repository at this point in the history
…DataView
  • Loading branch information
feross authored and James Halliday committed Dec 11, 2013
1 parent 654c375 commit 1ffacbc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -518,12 +518,12 @@ function packF32(v) { return packIEEE754(v, 8, 23); }
/** @constructor */
var DataView = function DataView(buffer, byteOffset, byteLength) {
if (arguments.length === 0) {
buffer = new ArrayBuffer(0);
} else if (!(buffer instanceof ArrayBuffer || ECMAScript.Class(buffer) === 'ArrayBuffer')) {
buffer = new exports.ArrayBuffer(0);
} else if (!(buffer instanceof exports.ArrayBuffer || ECMAScript.Class(buffer) === 'ArrayBuffer')) {
throw new TypeError("TypeError");
}

this.buffer = buffer || new ArrayBuffer(0);
this.buffer = buffer || new exports.ArrayBuffer(0);

this.byteOffset = ECMAScript.ToUint32(byteOffset);
if (this.byteOffset > this.buffer.byteLength) {
Expand Down

0 comments on commit 1ffacbc

Please sign in to comment.