]> git.proxmox.com Git - mirror_novnc.git/commitdiff
Fix slice usage in display tests on IE11
authorSolly Ross <sross@redhat.com>
Wed, 10 Jan 2018 16:08:21 +0000 (11:08 -0500)
committerSolly Ross <sross@redhat.com>
Wed, 10 Jan 2018 16:08:21 +0000 (11:08 -0500)
IE11 doesn't support the `slice` method on ArrayBufferViews, so
we have to use the old `Array.prototype.slice.call` trick in the
tests instead.

tests/test.display.js

index 60201edf79bf7f810d488a0cf8beae67dd5258f7..2e8f90e2f2e947715a69524edc1c3522e40ce383 100644 (file)
@@ -354,7 +354,8 @@ describe('Display/Canvas Helper', function () {
                 for (let x = 0;x < 16;x++) {
                     let pixel;
                     if ((x < 4) && (y < 4)) {
-                        pixel = checked_data.slice((y*4+x)*4, (y*4+x+1)*4);
+                        // NB: of course IE11 doesn't support #slice on ArrayBufferViews...
+                        pixel = Array.prototype.slice.call(checked_data, (y*4+x)*4, (y*4+x+1)*4);
                     } else {
                         pixel = [0, 0xff, 0, 255];
                     }