Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for ch5.md (Section - Multiple Views) #1090

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Jul 13, 2017

  1. Update for ch5.md (Section - Multiple Views)

    If we try using of "buf" = 2 bits, we will have exceptions for all variables.
    
    Browser: Chrome latest
    
    Exception:
    =========================
    VM200:2 Uncaught RangeError: Invalid typed array length: 2
        at typedArrayConstructByArrayBuffer (<anonymous>)
        at new Uint16Array (native)
        at <anonymous>:2:13
    =========================
    
    Valid example:
    =========================
    var buf1 = new ArrayBuffer( 4 );
    var first = new Uint16Array( buf1, 0, 2 )[0];
    
    var buf2 = new ArrayBuffer( 3 );
    var second = new Uint8Array( buf2, 2, 1 )[0];
    
    var buf3 = new ArrayBuffer( 4 );
    var third = new Uint8Array( buf3, 3, 1 )[0];
    
    var buf4 = new ArrayBuffer( 20 );
    var fourth = new Float32Array( buf4, 4, 4 )[0];
    =========================
    
    Need add to example "buf" = 20 or set custom "buf" for each variable.
    After that please update the text if this remark is correct.
    WispProxy committed Jul 13, 2017
    Configuration menu
    Copy the full SHA
    48959ce View commit details
    Browse the repository at this point in the history