@@ -74,6 +74,7 @@ FS.staticInit();
7474#else
7575 ErrnoError : class {
7676#endif
77+ name = 'ErrnoError' ;
7778 // We set the `name` property to be able to identify `FS.ErrnoError`
7879 // - the `name` is a standard ECMA-262 property of error objects. Kind of good to have it anyway.
7980 // - when using PROXYFS, an error can come from an underlying FS
@@ -84,9 +85,6 @@ FS.staticInit();
8485#if ASSERTIONS
8586 super ( runtimeInitialized ? strError ( errno ) : '' ) ;
8687#endif
87- // TODO(sbc): Use the inline member declaration syntax once we
88- // support it in acorn and closure.
89- this . name = 'ErrnoError' ;
9088 this . errno = errno ;
9189#if ASSERTIONS
9290 for ( var key in ERRNO_CODES ) {
@@ -100,16 +98,11 @@ FS.staticInit();
10098 } ,
10199
102100 FSStream : class {
103- constructor ( ) {
104- // TODO(https://github.com/emscripten-core/emscripten/issues/21414):
105- // Use inline field declarations.
106- this . shared = { } ;
101+ shared = { } ;
107102#if USE_CLOSURE_COMPILER
108- // Closure compiler requires us to declare all properties in the
109- // constructor.
110- this . node = null ;
103+ // Closure compiler requires us to declare all properties ahead of time
104+ node = null ;
111105#endif
112- }
113106 get object ( ) {
114107 return this . node ;
115108 }
@@ -139,21 +132,21 @@ FS.staticInit();
139132 }
140133 } ,
141134 FSNode : class {
135+ node_ops = { } ;
136+ stream_ops = { } ;
137+ readMode = { { { cDefs . S_IRUGO } } } | { { { cDefs . S_IXUGO } } } ;
138+ writeMode = { { { cDefs . S_IWUGO } } } ;
139+ mounted = null ;
142140 constructor ( parent , name , mode , rdev ) {
143141 if ( ! parent ) {
144142 parent = this ; // root node sets parent to itself
145143 }
146144 this . parent = parent ;
147145 this . mount = parent . mount ;
148- this . mounted = null ;
149146 this . id = FS . nextInode ++ ;
150147 this . name = name ;
151148 this . mode = mode ;
152- this . node_ops = { } ;
153- this . stream_ops = { } ;
154149 this . rdev = rdev ;
155- this . readMode = { { { cDefs . S_IRUGO } } } | { { { cDefs . S_IXUGO } } } ;
156- this . writeMode = { { { cDefs . S_IWUGO } } } ;
157150 }
158151 get read ( ) {
159152 return ( this . mode & this . readMode ) === this . readMode ;
@@ -1667,17 +1660,14 @@ FS.staticInit();
16671660 // Lazy chunked Uint8Array (implements get and length from Uint8Array).
16681661 // Actual getting is abstracted away for eventual reuse.
16691662 class LazyUint8Array {
1670- constructor ( ) {
1671- this . lengthKnown = false ;
1672- this . chunks = [ ] ; // Loaded chunks. Index is the chunk number
1663+ lengthKnown = false ;
1664+ chunks = [ ] ; // Loaded chunks. Index is the chunk number
16731665#if USE_CLOSURE_COMPILER
1674- // Closure compiler requires us to declare all properties in the
1675- // constructor.
1676- this . getter = undefined ;
1677- this . _length = 0 ;
1678- this . _chunkSize = 0 ;
1666+ // Closure compiler requires us to declare all properties ahead of time.
1667+ getter = undefined ;
1668+ _length = 0 ;
1669+ _chunkSize = 0 ;
16791670#endif
1680- }
16811671 get ( idx ) {
16821672 if ( idx > this . length - 1 || idx < 0 ) {
16831673 return undefined ;
0 commit comments