Commit 067dae5956ee6811ae781335f12ba2eb22196b69
remove writeStringToMem
Signed-off-by: wanderer <mjbecze@gmail.com>wanderer committed on 9/18/2017, 8:41:28 PM
Parent: 4840ee04dd0bfe2f709a2be37fe16e6119a46e90
Files changed
index.js | changed |
package-lock.json | changed |
package.json | changed |
index.js | ||
---|---|---|
@@ -185,16 +185,16 @@ | ||
185 | 185 … | |
186 | 186 … | function wrapInput (func, returnValue = false) { |
187 | 187 … | return function () { |
188 | 188 … | const args = [...arguments] |
189 | - const buf = args.pop() | |
189 … | + let buf = args.pop() | |
190 | 190 … | const ioMode = 0 |
191 | 191 … | const pos = mod._malloc(buf.length) |
192 | 192 … | if (typeof buf === 'string') { |
193 | - mod.writeStringToMemory(buf, pos) | |
194 | - } else { | |
195 | - mod.HEAP8.set(buf, pos) | |
193 … | + buf = Buffer.from(buf) | |
196 | 194 … | } |
195 … | + | |
196 … | + mod.HEAP8.set(buf, pos) | |
197 | 197 … | let r = func(...args, pos, buf.length, ioMode) |
198 | 198 … | mod._free(pos) |
199 | 199 … | if (returnValue) return r |
200 | 200 … | } |
package-lock.json | ||
---|---|---|
The diff is too large to show. Use a local git client to view these changes. Old file size: 250918 bytes New file size: 250779 bytes |
package.json | ||
---|---|---|
@@ -14,9 +14,11 @@ | ||
14 | 14 … | "" |
15 | 15 … | ], |
16 | 16 … | "author": "mjbecze <mjbecze@gmail.com>", |
17 | 17 … | "license": "MPL-2.0", |
18 | - "dependencies": {}, | |
18 … | + "dependencies": { | |
19 … | + "defined": "^1.0.0" | |
20 … | + }, | |
19 | 21 … | "devDependencies": { |
20 | 22 … | "array-shuffle": "^1.0.1", |
21 | 23 … | "coveralls": "^2.11.4", |
22 | 24 … | "documentation": "^5.2.0", |
Built with git-ssb-web