diff options
author | daurnimator <quae@daurnimator.com> | 2017-05-08 18:16:46 +1000 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2017-05-08 18:23:09 +1000 |
commit | 48d20ce3e2b38d1da536e42f225401fc06147d2a (patch) | |
tree | 7620d8ded7a7bb56bd4a513f9bacf0eeafcacfc7 /src | |
parent | 99b3623834113e86b4302c2027a0422a2cdd09c3 (diff) | |
download | fengari-48d20ce3e2b38d1da536e42f225401fc06147d2a.tar.gz fengari-48d20ce3e2b38d1da536e42f225401fc06147d2a.tar.bz2 fengari-48d20ce3e2b38d1da536e42f225401fc06147d2a.zip |
src/lapi.js: Use .svalue() getter for lua_todataview
Diffstat (limited to 'src')
-rw-r--r-- | src/lapi.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lapi.js b/src/lapi.js index bf62931..38c8bd7 100644 --- a/src/lapi.js +++ b/src/lapi.js @@ -647,8 +647,8 @@ const lua_todataview = function(L, idx) { if (!o.ttisstring() && !o.ttisnumber()) return null; - let dv = new DataView(new ArrayBuffer(o.value.length)); - o.value.forEach((e, i) => dv.setUint8(i, e, true)); + let dv = new DataView(new ArrayBuffer(o.vslen())); + o.svalue().forEach((e, i) => dv.setUint8(i, e, true)); return dv; }; |