@@ -932,7 +932,7 @@ Compiler.prototype.outputSuspensionHelpers = function (unit) {
932
932
}
933
933
}
934
934
935
- output += "try { $ret=susp.child.resume(); } catch(err) { if (!(err instanceof Sk.builtin.Exception )) { err = new Sk.builtin.ExternalError(err); } err.traceback.push({lineno: currLineNo, colno: currColNo, filename: '" + this . filename + "'}); if($exc.length>0) { $err=err; $blk=$exc.pop(); } else { throw err; } }" +
935
+ output += "try { $ret=susp.child.resume(); } catch(err) { if (!(err instanceof Sk.builtin.BaseException )) { err = new Sk.builtin.ExternalError(err); } err.traceback.push({lineno: currLineNo, colno: currColNo, filename: '" + this . filename + "'}); if($exc.length>0) { $err=err; $blk=$exc.pop(); } else { throw err; } }" +
936
936
"};" ;
937
937
938
938
output += "var $saveSuspension = function(child, filename, lineno, colno) {" +
@@ -1591,7 +1591,7 @@ Compiler.prototype.buildcodeobj = function (n, coname, decorator_list, args, cal
1591
1591
this . u . switchCode = "while(true){try{"
1592
1592
this . u . switchCode += this . outputInterruptTest ( ) ;
1593
1593
this . u . switchCode += "switch($blk){" ;
1594
- this . u . suffixCode = "} }catch(err){ if (!(err instanceof Sk.builtin.Exception )) { err = new Sk.builtin.ExternalError(err); } err.traceback.push({lineno: currLineNo, colno: currColNo, filename: '" + this . filename + "'}); if ($exc.length>0) { $err = err; $blk=$exc.pop(); continue; } else { throw err; }} }});" ;
1594
+ this . u . suffixCode = "} }catch(err){ if (!(err instanceof Sk.builtin.BaseException )) { err = new Sk.builtin.ExternalError(err); } err.traceback.push({lineno: currLineNo, colno: currColNo, filename: '" + this . filename + "'}); if ($exc.length>0) { $err = err; $blk=$exc.pop(); continue; } else { throw err; }} }});" ;
1595
1595
1596
1596
//
1597
1597
// jump back to the handler so it can do the main actual work of the
@@ -2230,8 +2230,6 @@ Compiler.prototype.cmod = function (mod) {
2230
2230
this . u . varDeclsCode += "if (typeof Sk.lastYield === 'undefined') {Sk.lastYield = Date.now()}" ;
2231
2231
}
2232
2232
2233
- this . u . varDeclsCode += "try {" ;
2234
-
2235
2233
this . u . varDeclsCode += "if (" + modf + ".wakingSuspension!==undefined) { $wakeFromSuspension(); }" +
2236
2234
"if (Sk.retainGlobals) {" +
2237
2235
" if (Sk.globals) { $gbl = Sk.globals; Sk.globals = $gbl; $loc = $gbl; }" +
@@ -2250,8 +2248,8 @@ Compiler.prototype.cmod = function (mod) {
2250
2248
this . u . switchCode = "while(true){try{" ;
2251
2249
this . u . switchCode += this . outputInterruptTest ( ) ;
2252
2250
this . u . switchCode += "switch($blk){" ;
2253
- this . u . suffixCode = "} }catch(err){ if (!(err instanceof Sk.builtin.Exception)) { err = new Sk.builtin.ExternalError(err); } err.traceback.push({lineno: currLineNo, colno: currColNo, filename: '" + this . filename + "'}); if ($exc.length>0) { $err = err; $blk=$exc.pop(); continue; } else { throw err; }} }" +
2254
- " }catch(err){ if (err instanceof Sk.builtin.SystemExit && !Sk.throwSystemExit) { Sk.misceval.print_ (err.toString() + '\\n' ); return $loc; } else { throw err; } } });";
2251
+ this . u . suffixCode = "}"
2252
+ this . u . suffixCode += " }catch(err){ if (!( err instanceof Sk.builtin.BaseException)) { err = new Sk.builtin.ExternalError (err); } err.traceback.push({lineno: currLineNo, colno: currColNo, filename: '" + this . filename + "'} ); if ($exc.length>0) { $err = err; $blk=$exc.pop(); continue; } else { throw err; } } } });";
2255
2253
2256
2254
// Note - this change may need to be adjusted for all the other instances of
2257
2255
// switchCode and suffixCode in this file. Not knowing how to test those
0 commit comments