From b32c467031b2be3b148f98d6d72f5bc8ee584cbf Mon Sep 17 00:00:00 2001 From: Project Nayuki Date: Tue, 2 Oct 2018 00:06:15 +0000 Subject: [PATCH] Tweaked JavaScript code to implement inheritance more correctly. --- javascript/qrcodegen.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/javascript/qrcodegen.js b/javascript/qrcodegen.js index 13d7abf..6ca8618 100644 --- a/javascript/qrcodegen.js +++ b/javascript/qrcodegen.js @@ -954,6 +954,7 @@ var qrcodegen = new function() { * This constructor creates an empty bit buffer (length 0). */ function BitBuffer() { + Array.call(this); // Packs this buffer's bits into bytes in big endian, // padding with '0' bit values, and returns the new array. @@ -978,5 +979,6 @@ var qrcodegen = new function() { } BitBuffer.prototype = Object.create(Array.prototype); + BitBuffer.prototype.constructor = BitBuffer; };