• Michael Droettboom's avatar
    Fix #93 by avoiding use of TextDecoder · a07b6f39
    Michael Droettboom authored
    Any use of TextDecoder on a part of the Wasm HEAP seems to cause crashes
    when using WebAssembly.instantiate later on (in Chrome).
    
    The fix is to:
    
    - Avoid use of TextDecoder in emscripten-generated code by setting
      -s TEXTDECODER=0
    - Do the Python-to-JS string conversion a different way:
    
      - Handle the native format of a Python Unicode string (which is either UCS1,
        UCS 2 or UCS 4) directly.  This has the added advantage of being
        computationally simpler than encoding/decoding to/from UTF8.
    a07b6f39
python2js.c 5.55 KB