mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Clone the array manually when slice is missing
This commit is contained in:
parent
9e2bf0f8ce
commit
bf837cb524
1 changed files with 7 additions and 1 deletions
|
@ -55,8 +55,14 @@
|
|||
result = [];
|
||||
for (var i = 0; i < arg1; ++i)
|
||||
result[i] = 0;
|
||||
} else
|
||||
} else if ('slice' in arg1) {
|
||||
result = arg1.slice(0);
|
||||
} else {
|
||||
result = [];
|
||||
for (var i = 0, n = arg1.length; i < n; ++i) {
|
||||
result[i] = arg1[i];
|
||||
}
|
||||
}
|
||||
|
||||
result.subarray = subarray;
|
||||
result.buffer = result;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue