File tree 2 files changed +8
-1
lines changed
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -242,6 +242,8 @@ var LibraryPThread = {
242
242
Module [ 'print' ] ( 'Thread ' + e . data . threadId + ': ' + e . data . text ) ;
243
243
} else if ( e . data . cmd === 'printErr' ) {
244
244
Module [ 'printErr' ] ( 'Thread ' + e . data . threadId + ': ' + e . data . text ) ;
245
+ } else if ( e . data . cmd == 'alert' ) {
246
+ alert ( 'Thread ' + e . data . threadId + ': ' + e . data . text ) ;
245
247
} else if ( e . data . cmd === 'exit' ) {
246
248
// todo
247
249
} else if ( e . data . cmd === 'cancelDone' ) {
Original file line number Diff line number Diff line change @@ -31,7 +31,10 @@ function threadPrintErr() {
31
31
var text = Array . prototype . slice . call ( arguments ) . join ( ' ' ) ;
32
32
postMessage ( { cmd : 'printErr' , text : text , threadId : selfThreadId } ) ;
33
33
}
34
-
34
+ function threadAlert ( ) {
35
+ var text = Array . prototype . slice . call ( arguments ) . join ( ' ' ) ;
36
+ postMessage ( { cmd : 'alert' , text : text , threadId : selfThreadId } ) ;
37
+ }
35
38
Module [ 'print' ] = threadPrint ;
36
39
Module [ 'printErr' ] = threadPrintErr ;
37
40
@@ -41,6 +44,8 @@ console = {
41
44
error : threadPrintErr
42
45
} ;
43
46
47
+ this . alert = threadAlert ;
48
+
44
49
this . onmessage = function ( e ) {
45
50
if ( e . data . cmd === 'load' ) { // Preload command that is called once per worker to parse and load the Emscripten code.
46
51
buffer = e . data . buffer ;
You can’t perform that action at this time.
0 commit comments