File tree Expand file tree Collapse file tree 3 files changed +4
-11
lines changed Expand file tree Collapse file tree 3 files changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -40,9 +40,8 @@ class PDFWorkerStream {
4040 }
4141
4242 cancelAllRequests ( reason ) {
43- if ( this . _fullRequestReader ) {
44- this . _fullRequestReader . cancel ( reason ) ;
45- }
43+ this . _fullRequestReader ?. cancel ( reason ) ;
44+
4645 for ( const reader of this . _rangeRequestReaders . slice ( 0 ) ) {
4746 reader . cancel ( reason ) ;
4847 }
Original file line number Diff line number Diff line change @@ -3153,11 +3153,7 @@ class PDFObjects {
31533153 * @returns {Object }
31543154 */
31553155 #ensureObj( objId ) {
3156- const obj = this . #objs[ objId ] ;
3157- if ( obj ) {
3158- return obj ;
3159- }
3160- return ( this . #objs[ objId ] = {
3156+ return ( this . #objs[ objId ] ||= {
31613157 capability : new PromiseCapability ( ) ,
31623158 data : null ,
31633159 } ) ;
Original file line number Diff line number Diff line change @@ -107,9 +107,7 @@ class Sandbox {
107107 }
108108
109109 dumpMemoryUse ( ) {
110- if ( this . _module ) {
111- this . _module . ccall ( "dumpMemoryUse" , null , [ ] ) ;
112- }
110+ this . _module ?. ccall ( "dumpMemoryUse" , null , [ ] ) ;
113111 }
114112
115113 nukeSandbox ( ) {
You can’t perform that action at this time.
0 commit comments