diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-04-09 14:46:17 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-04-09 14:46:17 -0700 |
commit | caf96166b682fff077d9a181eb61108592f7d6e5 (patch) | |
tree | cb9bccf95989ab57540ea2b8e488f2153bd5a73e | |
parent | 8ffdfa12fb3cff6f60ece2cd8c1fc7149e48e8bc (diff) |
use Array prototype slice in mmap, since contents may not be an Array
-rw-r--r-- | src/library.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/library.js b/src/library.js index cc28ce6f..56583c76 100644 --- a/src/library.js +++ b/src/library.js @@ -3302,8 +3302,9 @@ LibraryManager.library = { } var info = FS.streams[stream]; if (!info) return -1; - return allocate(info.object.contents.slice(offset, offset+num), - 'i8', ALLOC_NORMAL); + var contents = info.object.contents; + contents = Array.prototype.slice.call(contents, offset, offset+num); + return allocate(contents, 'i8', ALLOC_NORMAL); }, __01mmap64_: 'mmap', |