File tree 3 files changed +9
-4
lines changed
3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -173,7 +173,7 @@ define([
173
173
} ;
174
174
175
175
// Web assembly not supported, use fallback js module if provided
176
- if ( ! processor . _supportsWasm ) {
176
+ if ( ! FeatureDetection . supportsWebAssembly ( ) ) {
177
177
if ( ! defined ( wasmOptions . fallbackModulePath ) ) {
178
178
throw new RuntimeError ( 'This browser does not support Web Assembly, and no backup module was provided for ' + processor . _workerName ) ;
179
179
}
@@ -214,7 +214,6 @@ define([
214
214
this . _activeTasks = 0 ;
215
215
this . _deferreds = { } ;
216
216
this . _nextID = 0 ;
217
- this . _supportsWasm = FeatureDetection . supportsWebAssembly ( ) ; // exposed for testing purposes
218
217
}
219
218
220
219
var emptyTransferableObjectArray = [ ] ;
Original file line number Diff line number Diff line change @@ -225,6 +225,10 @@ define([
225
225
// Require and compile WebAssembly module, or use fallback if not supported
226
226
return require ( [ wasmConfig . modulePath ] , function ( dracoModule ) {
227
227
if ( defined ( wasmConfig . wasmBinaryFile ) ) {
228
+ if ( ! defined ( dracoModule ) ) {
229
+ dracoModule = self . DracoDecoderModule ;
230
+ }
231
+
228
232
dracoModule ( wasmConfig ) . then ( function ( compiledModule ) {
229
233
initWorker ( compiledModule ) ;
230
234
} ) ;
Original file line number Diff line number Diff line change @@ -190,7 +190,8 @@ defineSuite([
190
190
it ( 'uses a backup module if web assembly is not supported' , function ( ) {
191
191
var binaryUrl = absolutize ( require . toUrl ( '../TestWorkers/TestWasm/testWasm.wasm' ) ) ;
192
192
taskProcessor = new TaskProcessor ( 'returnWasmConfig' , 5 ) ;
193
- taskProcessor . _supportsWasm = false ;
193
+
194
+ spyOn ( FeatureDetection , 'supportsWebAssembly' ) . and . returnValue ( false ) ;
194
195
195
196
var promise = taskProcessor . initWebAssemblyModule ( {
196
197
modulePath : 'TestWasm/testWasmWrapper' ,
@@ -208,7 +209,8 @@ defineSuite([
208
209
it ( 'throws runtime error if web assembly is not supported and no backup is provided' , function ( ) {
209
210
var binaryUrl = absolutize ( require . toUrl ( '../TestWorkers/TestWasm/testWasm.wasm' ) ) ;
210
211
taskProcessor = new TaskProcessor ( 'returnWasmConfig' , 5 ) ;
211
- taskProcessor . _supportsWasm = false ;
212
+
213
+ spyOn ( FeatureDetection , 'supportsWebAssembly' ) . and . returnValue ( false ) ;
212
214
213
215
expect ( function ( ) {
214
216
taskProcessor . initWebAssemblyModule ( {
You can’t perform that action at this time.
0 commit comments