@@ -112,36 +112,44 @@ var LibraryIDBStore = {
112
112
emscripten_idb_store__async : true ,
113
113
emscripten_idb_store : ( db , id , ptr , num , perror ) => Asyncify . handleSleep ( ( wakeUp ) => {
114
114
IDBStore . setFile ( UTF8ToString ( db ) , UTF8ToString ( id ) , new Uint8Array ( HEAPU8 . subarray ( ptr , ptr + num ) ) , ( error ) => {
115
+ // Closure warns about storing booleans in TypedArrays.
116
+ /** @suppress {checkTypes} */
115
117
{ { { makeSetValue ( 'perror' , 0 , '!!error' , 'i32' ) } } } ;
116
118
wakeUp ( ) ;
117
119
} ) ;
118
120
} ) ,
119
121
emscripten_idb_delete__async : true ,
120
122
emscripten_idb_delete : ( db , id , perror ) => Asyncify . handleSleep ( ( wakeUp ) => {
121
123
IDBStore . deleteFile ( UTF8ToString ( db ) , UTF8ToString ( id ) , ( error ) => {
124
+ /** @suppress {checkTypes} */
122
125
{ { { makeSetValue ( 'perror' , 0 , '!!error' , 'i32' ) } } } ;
123
126
wakeUp ( ) ;
124
127
} ) ;
125
128
} ) ,
126
129
emscripten_idb_exists__async : true ,
127
130
emscripten_idb_exists : ( db , id , pexists , perror ) => Asyncify . handleSleep ( ( wakeUp ) => {
128
131
IDBStore . existsFile ( UTF8ToString ( db ) , UTF8ToString ( id ) , ( error , exists ) => {
132
+ /** @suppress {checkTypes} */
129
133
{ { { makeSetValue ( 'pexists' , 0 , '!!exists' , 'i32' ) } } } ;
134
+ /** @suppress {checkTypes} */
130
135
{ { { makeSetValue ( 'perror' , 0 , '!!error' , 'i32' ) } } } ;
131
136
wakeUp ( ) ;
132
137
} ) ;
133
138
} ) ,
134
139
emscripten_idb_clear__async : true ,
135
140
emscripten_idb_clear : ( db , perror ) => Asyncify . handleSleep ( ( wakeUp ) => {
136
141
IDBStore . clearStore ( UTF8ToString ( db ) , ( error ) => {
142
+ /** @suppress {checkTypes} */
137
143
{ { { makeSetValue ( 'perror' , 0 , '!!error' , 'i32' ) } } } ;
138
144
wakeUp ( ) ;
139
145
} ) ;
140
146
} ) ,
141
147
// extra worker methods - proxied
142
148
emscripten_idb_load_blob__async : true ,
143
149
emscripten_idb_load_blob : ( db , id , pblob , perror ) => Asyncify . handleSleep ( ( wakeUp ) => {
150
+ #if ASSERTIONS
144
151
assert ( ! IDBStore . pending ) ;
152
+ #endif
145
153
IDBStore . pending = ( msg ) => {
146
154
IDBStore . pending = null ;
147
155
var blob = msg . blob ;
@@ -150,7 +158,9 @@ var LibraryIDBStore = {
150
158
wakeUp ( ) ;
151
159
return ;
152
160
}
161
+ #if ASSERTIONS
153
162
assert ( blob instanceof Blob ) ;
163
+ #endif
154
164
var blobId = IDBStore . blobs . length ;
155
165
IDBStore . blobs . push ( blob ) ;
156
166
{ { { makeSetValue ( 'pblob' , 0 , 'blobId' , 'i32' ) } } } ;
@@ -165,7 +175,9 @@ var LibraryIDBStore = {
165
175
} ) ,
166
176
emscripten_idb_store_blob__async : true ,
167
177
emscripten_idb_store_blob : ( db , id , ptr , num , perror ) => Asyncify . handleSleep ( ( wakeUp ) => {
178
+ #if ASSERTIONS
168
179
assert ( ! IDBStore . pending ) ;
180
+ #endif
169
181
IDBStore . pending = ( msg ) => {
170
182
IDBStore . pending = null ;
171
183
{ { { makeSetValue ( 'perror' , 0 , '!!msg.error' , 'i32' ) } } } ;
@@ -188,7 +200,9 @@ var LibraryIDBStore = {
188
200
return 0 ;
189
201
} ,
190
202
emscripten_idb_free_blob : ( blobId ) => {
203
+ #if ASSERTIONS
191
204
assert ( IDBStore . blobs [ blobId ] ) ;
205
+ #endif
192
206
IDBStore . blobs [ blobId ] = null ;
193
207
} ,
194
208
#else
0 commit comments