• source navigation  • diff markup  • identifier search  • freetext search  • 

Sources/ucode/tests/custom/04_modules/19_dynamic_import_module_exception

  1 This testcase verifies that an import of a dynamically loaded module
  2 whose body raises an exception reports that exception to the importer.
  3 
  4 The module is returned with the exports it reached before the
  5 exception. The import must not resolve its names against these
  6 exports and report a missing export in place of the original error.
  7 
  8 -- Testcase --
  9 let fn = loadstring('import { a, b } from "raiser";\nprint(a, b, "\\n");\n', {
 10         raw_mode: true,
 11         force_dynlink_list: [ 'raiser' ]
 12 });
 13 
 14 try {
 15         fn();
 16 }
 17 catch (e) {
 18         print(e.type, ": ", e.message, "\n");
 19 }
 20 -- End --
 21 
 22 -- File raiser.uc --
 23 export const a = 1;
 24 
 25 die("raised in module");
 26 
 27 export const b = 2;
 28 -- End --
 29 
 30 -- Args --
 31 -R -L files/
 32 -- End --
 33 
 34 -- Expect stdout --
 35 Error: raised in module
 36 -- End --

This page was automatically generated by LXR 0.3.1.  •  OpenWrt