Skip to content

Commit

Permalink
chore: change v.at(-1) to v[v.length - 1] for old browsers with n…
Browse files Browse the repository at this point in the history
…o `at()` support
  • Loading branch information
MurakamiShinyu committed Mar 24, 2023
1 parent 620e5fd commit edfb241
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/core/src/vivliostyle/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2308,7 +2308,7 @@ export class Column extends VtreeImpl.Container implements Layout.Column {

// Workaround for the case of block child after text in parent block
// (Issue #1036)
let lastNode = checkPoints.at(-1).viewNode;
let lastNode = checkPoints[checkPoints.length - 1].viewNode;
if (lastNode?.parentElement.localName === "viv-ts-inner") {
lastNode = lastNode.parentElement.parentElement;
}
Expand Down Expand Up @@ -2823,7 +2823,9 @@ export class Column extends VtreeImpl.Container implements Layout.Column {
? LayoutHelper.findAncestorSpecialInlineNodeContext(
lastAfterNodeContext,
)
: this.breakPositions.at(-1) instanceof BoxBreakPosition)
: this.breakPositions[
this.breakPositions.length - 1
] instanceof BoxBreakPosition)
) {
this.saveEdgeBreakPosition(
nodeContext.copy(),
Expand Down

1 comment on commit edfb241

@vercel
Copy link

@vercel vercel bot commented on edfb241 Mar 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

vivliostyle – ./

vivliostyle-vivliostyle.vercel.app
vivliostyle.vercel.app
vivliostyle-git-master-vivliostyle.vercel.app

Please sign in to comment.