Created
May 16, 2014 19:50
-
-
Save katlogic/85c767797603cdba3111 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
let Buffer = function(a,b) | |
{ | |
if (!(this instanceof Buffer)) | |
return new Buffer(a, b) | |
let self = Uint8Array.call(this,a,b) | |
self.__proto__ = Buffer.prototype | |
return self | |
} | |
Buffer.prototype = Object.create(Uint8Array.prototype, Buffer.prototype) | |
Buffer.prototype.x = 1 | |
let x = new Buffer(12) | |
console.log(x instanceof Buffer) | |
console.log(x instanceof Uint8Array) | |
console.log(x.slice) | |
console.log(x.x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment