DataView doesn't work use Uint8Array instead

This commit is contained in:
Krasimir Angelov
2022-08-31 16:21:08 +02:00
parent 0b01f56fd7
commit 4ecd216796
2 changed files with 2 additions and 2 deletions

View File

@@ -5,7 +5,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<script type="text/javascript" src=".libs/pgf.js"></script>
<script type="text/javascript" src="pgf.js"></script>
<script type="text/javascript" src="./jspgf.js"></script>
<script type="text/javascript" src="./test-web.js"></script>
</body>

View File

@@ -5,7 +5,7 @@ Module.onRuntimeInitialized = () => {
.then((response) => response.arrayBuffer())
.then((data) => {
const pgfPathFS = '/tmp/Foods.pgf';
Module.FS.writeFile(pgfPathFS, new DataView(data));
Module.FS.writeFile(pgfPathFS, new Uint8Array(data));
// Read PGF
const pgf = JSPGF.readPGF(pgfPathFS);