File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed
Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,10 @@ export class Kernel {
4343 * Set to true for timing data to be emitted.
4444 */
4545 public debugTimingEnabled = false ;
46+ /**
47+ * Set to true to validate assemblies upon loading (slow).
48+ */
49+ public validateAssemblies = false ;
4650
4751 readonly #assemblies = new Map < string , Assembly > ( ) ;
4852 readonly #objects = new ObjectTable ( this . #typeInfoForFqn. bind ( this ) ) ;
@@ -151,7 +155,7 @@ export class Kernel {
151155 let assmSpec : spec . Assembly ;
152156 try {
153157 assmSpec = this . #debugTime(
154- ( ) => spec . loadAssemblyFromPath ( packageDir ) ,
158+ ( ) => spec . loadAssemblyFromPath ( packageDir , this . validateAssemblies ) ,
155159 `loadAssemblyFromPath(${ packageDir } )` ,
156160 ) ;
157161 } catch ( e : any ) {
Original file line number Diff line number Diff line change @@ -20,10 +20,12 @@ export class KernelHost {
2020 debug ?: boolean ;
2121 debugTiming ?: boolean ;
2222 noStack ?: boolean ;
23+ validateAssemblies ?: boolean ;
2324 } = { } ,
2425 ) {
2526 this . kernel . traceEnabled = opts . debug ?? false ;
2627 this . kernel . debugTimingEnabled = opts . debugTiming ?? false ;
28+ this . kernel . validateAssemblies = opts . validateAssemblies ?? false ;
2729 }
2830
2931 public run ( ) {
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ const version = packageInfo.version;
99const noStack = ! ! process . env . JSII_NOSTACK ;
1010const debug = ! ! process . env . JSII_DEBUG ;
1111const debugTiming = ! ! process . env . JSII_DEBUG_TIMING ;
12+ const validateAssemblies = ! ! process . env . JSII_VALIDATE_ASSEMBLIES ;
1213
1314// This assumes FD#3 is opened for reading and writing. This is normally
1415// performed by`bin/jsii-runtime.js`, and we will not be verifying this once
@@ -25,7 +26,12 @@ const stdio = new SyncStdio({
2526} ) ;
2627
2728const inout = new InputOutput ( stdio ) ;
28- const host = new KernelHost ( inout , { debug, noStack, debugTiming } ) ;
29+ const host = new KernelHost ( inout , {
30+ debug,
31+ noStack,
32+ debugTiming,
33+ validateAssemblies,
34+ } ) ;
2935
3036host . once ( 'exit' , process . exit . bind ( process ) ) ;
3137
You can’t perform that action at this time.
0 commit comments