@@ -2462,9 +2462,7 @@ class ExclGroup extends XFAObject {
2462
2462
2463
2463
setAccess ( this , attributes . class ) ;
2464
2464
2465
- if ( ! this [ $extra ] ) {
2466
- this [ $extra ] = Object . create ( null ) ;
2467
- }
2465
+ this [ $extra ] ||= Object . create ( null ) ;
2468
2466
2469
2467
Object . assign ( this [ $extra ] , {
2470
2468
children,
@@ -2953,9 +2951,7 @@ class Field extends XFAObject {
2953
2951
}
2954
2952
}
2955
2953
2956
- if ( ! ui . attributes . style ) {
2957
- ui . attributes . style = Object . create ( null ) ;
2958
- }
2954
+ ui . attributes . style ||= Object . create ( null ) ;
2959
2955
2960
2956
let aElement = null ;
2961
2957
@@ -3048,9 +3044,7 @@ class Field extends XFAObject {
3048
3044
caption . attributes . class [ 0 ] = "xfaCaptionForCheckButton" ;
3049
3045
}
3050
3046
3051
- if ( ! ui . attributes . class ) {
3052
- ui . attributes . class = [ ] ;
3053
- }
3047
+ ui . attributes . class ||= [ ] ;
3054
3048
3055
3049
ui . children . splice ( 0 , 0 , caption ) ;
3056
3050
@@ -4067,11 +4061,9 @@ class PageArea extends XFAObject {
4067
4061
}
4068
4062
4069
4063
[ $getNextPage ] ( ) {
4070
- if ( ! this [ $extra ] ) {
4071
- this [ $extra ] = {
4072
- numberOfUse : 0 ,
4073
- } ;
4074
- }
4064
+ this [ $extra ] ||= {
4065
+ numberOfUse : 0 ,
4066
+ } ;
4075
4067
4076
4068
const parent = this [ $getParent ] ( ) ;
4077
4069
if ( parent . relation === "orderedOccurrence" ) {
@@ -4090,11 +4082,9 @@ class PageArea extends XFAObject {
4090
4082
4091
4083
[ $toHTML ] ( ) {
4092
4084
// TODO: incomplete.
4093
- if ( ! this [ $extra ] ) {
4094
- this [ $extra ] = {
4095
- numberOfUse : 1 ,
4096
- } ;
4097
- }
4085
+ this [ $extra ] ||= {
4086
+ numberOfUse : 1 ,
4087
+ } ;
4098
4088
4099
4089
const children = [ ] ;
4100
4090
this [ $extra ] . children = children ;
@@ -4186,13 +4176,11 @@ class PageSet extends XFAObject {
4186
4176
}
4187
4177
4188
4178
[ $getNextPage ] ( ) {
4189
- if ( ! this [ $extra ] ) {
4190
- this [ $extra ] = {
4191
- numberOfUse : 1 ,
4192
- pageIndex : - 1 ,
4193
- pageSetIndex : - 1 ,
4194
- } ;
4195
- }
4179
+ this [ $extra ] ||= {
4180
+ numberOfUse : 1 ,
4181
+ pageIndex : - 1 ,
4182
+ pageSetIndex : - 1 ,
4183
+ } ;
4196
4184
4197
4185
if ( this . relation === "orderedOccurrence" ) {
4198
4186
if ( this [ $extra ] . pageIndex + 1 < this . pageArea . children . length ) {
@@ -5067,9 +5055,7 @@ class Subform extends XFAObject {
5067
5055
5068
5056
setAccess ( this , attributes . class ) ;
5069
5057
5070
- if ( ! this [ $extra ] ) {
5071
- this [ $extra ] = Object . create ( null ) ;
5072
- }
5058
+ this [ $extra ] ||= Object . create ( null ) ;
5073
5059
5074
5060
Object . assign ( this [ $extra ] , {
5075
5061
children,
@@ -5495,9 +5481,7 @@ class Template extends XFAObject {
5495
5481
}
5496
5482
}
5497
5483
5498
- if ( ! pageArea ) {
5499
- pageArea = pageAreas [ 0 ] ;
5500
- }
5484
+ pageArea ||= pageAreas [ 0 ] ;
5501
5485
5502
5486
pageArea [ $extra ] = {
5503
5487
numberOfUse : 1 ,
0 commit comments