mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 09:38:06 +02:00
Replace some Array.prototype
-usage with spread syntax
We have a few, quite old, call-sites that use the `Array.prototype`-format and which can now be replaced with spread syntax instead.
This commit is contained in:
parent
91bdcd8b20
commit
6538409282
3 changed files with 6 additions and 17 deletions
|
@ -523,9 +523,7 @@ class PostScriptStack {
|
|||
}
|
||||
|
||||
constructor(initialStack) {
|
||||
this.stack = !initialStack
|
||||
? []
|
||||
: Array.prototype.slice.call(initialStack, 0);
|
||||
this.stack = initialStack ? Array.from(initialStack) : [];
|
||||
}
|
||||
|
||||
push(value) {
|
||||
|
@ -1201,10 +1199,7 @@ class PostScriptCompiler {
|
|||
if (j === 0) {
|
||||
break; // just skipping -- there are nothing to rotate
|
||||
}
|
||||
Array.prototype.push.apply(
|
||||
stack,
|
||||
stack.splice(stack.length - n, n - j)
|
||||
);
|
||||
stack.push(...stack.splice(stack.length - n, n - j));
|
||||
break;
|
||||
default:
|
||||
return null; // unsupported operator
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue