Tweaked JavaScript code to implement inheritance more correctly.

This commit is contained in:
Project Nayuki 2018-10-02 00:06:15 +00:00
parent 4eee2d43e6
commit b32c467031
1 changed files with 2 additions and 0 deletions

View File

@ -954,6 +954,7 @@ var qrcodegen = new function() {
* This constructor creates an empty bit buffer (length 0). * This constructor creates an empty bit buffer (length 0).
*/ */
function BitBuffer() { function BitBuffer() {
Array.call(this);
// Packs this buffer's bits into bytes in big endian, // Packs this buffer's bits into bytes in big endian,
// padding with '0' bit values, and returns the new array. // 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 = Object.create(Array.prototype);
BitBuffer.prototype.constructor = BitBuffer;
}; };