@@ -2462,9 +2462,7 @@ class ExclGroup extends XFAObject {
24622462
24632463 setAccess ( this , attributes . class ) ;
24642464
2465- if ( ! this [ $extra ] ) {
2466- this [ $extra ] = Object . create ( null ) ;
2467- }
2465+ this [ $extra ] ||= Object . create ( null ) ;
24682466
24692467 Object . assign ( this [ $extra ] , {
24702468 children,
@@ -2953,9 +2951,7 @@ class Field extends XFAObject {
29532951 }
29542952 }
29552953
2956- if ( ! ui . attributes . style ) {
2957- ui . attributes . style = Object . create ( null ) ;
2958- }
2954+ ui . attributes . style ||= Object . create ( null ) ;
29592955
29602956 let aElement = null ;
29612957
@@ -3048,9 +3044,7 @@ class Field extends XFAObject {
30483044 caption . attributes . class [ 0 ] = "xfaCaptionForCheckButton" ;
30493045 }
30503046
3051- if ( ! ui . attributes . class ) {
3052- ui . attributes . class = [ ] ;
3053- }
3047+ ui . attributes . class ||= [ ] ;
30543048
30553049 ui . children . splice ( 0 , 0 , caption ) ;
30563050
@@ -4067,11 +4061,9 @@ class PageArea extends XFAObject {
40674061 }
40684062
40694063 [ $getNextPage ] ( ) {
4070- if ( ! this [ $extra ] ) {
4071- this [ $extra ] = {
4072- numberOfUse : 0 ,
4073- } ;
4074- }
4064+ this [ $extra ] ||= {
4065+ numberOfUse : 0 ,
4066+ } ;
40754067
40764068 const parent = this [ $getParent ] ( ) ;
40774069 if ( parent . relation === "orderedOccurrence" ) {
@@ -4090,11 +4082,9 @@ class PageArea extends XFAObject {
40904082
40914083 [ $toHTML ] ( ) {
40924084 // TODO: incomplete.
4093- if ( ! this [ $extra ] ) {
4094- this [ $extra ] = {
4095- numberOfUse : 1 ,
4096- } ;
4097- }
4085+ this [ $extra ] ||= {
4086+ numberOfUse : 1 ,
4087+ } ;
40984088
40994089 const children = [ ] ;
41004090 this [ $extra ] . children = children ;
@@ -4186,13 +4176,11 @@ class PageSet extends XFAObject {
41864176 }
41874177
41884178 [ $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+ } ;
41964184
41974185 if ( this . relation === "orderedOccurrence" ) {
41984186 if ( this [ $extra ] . pageIndex + 1 < this . pageArea . children . length ) {
@@ -5067,9 +5055,7 @@ class Subform extends XFAObject {
50675055
50685056 setAccess ( this , attributes . class ) ;
50695057
5070- if ( ! this [ $extra ] ) {
5071- this [ $extra ] = Object . create ( null ) ;
5072- }
5058+ this [ $extra ] ||= Object . create ( null ) ;
50735059
50745060 Object . assign ( this [ $extra ] , {
50755061 children,
@@ -5495,9 +5481,7 @@ class Template extends XFAObject {
54955481 }
54965482 }
54975483
5498- if ( ! pageArea ) {
5499- pageArea = pageAreas [ 0 ] ;
5500- }
5484+ pageArea ||= pageAreas [ 0 ] ;
55015485
55025486 pageArea [ $extra ] = {
55035487 numberOfUse : 1 ,
0 commit comments