@@ -74,6 +74,7 @@ FS.staticInit();
74
74
#else
75
75
ErrnoError : class {
76
76
#endif
77
+ name = 'ErrnoError' ;
77
78
// We set the `name` property to be able to identify `FS.ErrnoError`
78
79
// - the `name` is a standard ECMA-262 property of error objects. Kind of good to have it anyway.
79
80
// - when using PROXYFS, an error can come from an underlying FS
@@ -84,9 +85,6 @@ FS.staticInit();
84
85
#if ASSERTIONS
85
86
super ( runtimeInitialized ? strError ( errno ) : '' ) ;
86
87
#endif
87
- // TODO(sbc): Use the inline member declaration syntax once we
88
- // support it in acorn and closure.
89
- this . name = 'ErrnoError' ;
90
88
this . errno = errno ;
91
89
#if ASSERTIONS
92
90
for ( var key in ERRNO_CODES ) {
@@ -100,16 +98,11 @@ FS.staticInit();
100
98
} ,
101
99
102
100
FSStream : class {
103
- constructor ( ) {
104
- // TODO(https://github.com/emscripten-core/emscripten/issues/21414):
105
- // Use inline field declarations.
106
- this . shared = { } ;
101
+ shared = { } ;
107
102
#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 ;
111
105
#endif
112
- }
113
106
get object ( ) {
114
107
return this . node ;
115
108
}
@@ -139,21 +132,21 @@ FS.staticInit();
139
132
}
140
133
} ,
141
134
FSNode : class {
135
+ node_ops = { } ;
136
+ stream_ops = { } ;
137
+ readMode = { { { cDefs . S_IRUGO } } } | { { { cDefs . S_IXUGO } } } ;
138
+ writeMode = { { { cDefs . S_IWUGO } } } ;
139
+ mounted = null ;
142
140
constructor ( parent , name , mode , rdev ) {
143
141
if ( ! parent ) {
144
142
parent = this ; // root node sets parent to itself
145
143
}
146
144
this . parent = parent ;
147
145
this . mount = parent . mount ;
148
- this . mounted = null ;
149
146
this . id = FS . nextInode ++ ;
150
147
this . name = name ;
151
148
this . mode = mode ;
152
- this . node_ops = { } ;
153
- this . stream_ops = { } ;
154
149
this . rdev = rdev ;
155
- this . readMode = { { { cDefs . S_IRUGO } } } | { { { cDefs . S_IXUGO } } } ;
156
- this . writeMode = { { { cDefs . S_IWUGO } } } ;
157
150
}
158
151
get read ( ) {
159
152
return ( this . mode & this . readMode ) === this . readMode ;
@@ -1667,17 +1660,14 @@ FS.staticInit();
1667
1660
// Lazy chunked Uint8Array (implements get and length from Uint8Array).
1668
1661
// Actual getting is abstracted away for eventual reuse.
1669
1662
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
1673
1665
#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 ;
1679
1670
#endif
1680
- }
1681
1671
get ( idx ) {
1682
1672
if ( idx > this . length - 1 || idx < 0 ) {
1683
1673
return undefined ;
0 commit comments