@@ -8,7 +8,7 @@ import path = require('path');
88import ts = require( 'typescript' ) ;
99import { JSII_DIAGNOSTICS_CODE } from './compiler' ;
1010import { getReferencedDocParams , parseSymbolDocumentation } from './docs' ;
11- import { Diagnostic , Emitter } from './emitter' ;
11+ import { Diagnostic , Emitter , EmitResult } from './emitter' ;
1212import literate = require( './literate' ) ;
1313import { ProjectInfo } from './project-info' ;
1414import utils = require( './utils' ) ;
@@ -90,7 +90,7 @@ export class Assembler implements Emitter {
9090 // Clearing ``this._types`` to allow contents to be garbage-collected.
9191 delete this . _types ;
9292 try {
93- return { diagnostics : this . _diagnostics , emitSkipped : true } ;
93+ return { diagnostics : this . _diagnostics , hasErrors : true } ;
9494 } finally {
9595 // Clearing ``this._diagnostics`` to allow contents to be garbage-collected.
9696 delete this . _diagnostics ;
@@ -121,7 +121,7 @@ export class Assembler implements Emitter {
121121
122122 const validator = new Validator ( this . projectInfo , assembly ) ;
123123 const validationResult = await validator . emit ( ) ;
124- if ( ! validationResult . emitSkipped ) {
124+ if ( ! validationResult . hasErrors ) {
125125 const assemblyPath = path . join ( this . projectInfo . projectRoot , '.jsii' ) ;
126126 LOG . trace ( `Emitting assembly: ${ colors . blue ( assemblyPath ) } ` ) ;
127127 await fs . writeJson ( assemblyPath , _fingerprint ( assembly ) , { replacer : utils . filterEmpty , spaces : 2 } ) ;
@@ -130,7 +130,7 @@ export class Assembler implements Emitter {
130130 try {
131131 return {
132132 diagnostics : [ ...this . _diagnostics , ...validationResult . diagnostics ] ,
133- emitSkipped : validationResult . emitSkipped
133+ hasErrors : validationResult . hasErrors
134134 } ;
135135 } finally {
136136 // Clearing ``this._types`` to allow contents to be garbage-collected.
@@ -1232,22 +1232,6 @@ export class Assembler implements Emitter {
12321232 }
12331233}
12341234
1235- /**
1236- * The result of ``Assembler#emit()``.
1237- */
1238- export interface EmitResult {
1239- /**
1240- * @return all diagnostic information produced by the assembler's emit process
1241- */
1242- readonly diagnostics : ts . Diagnostic [ ] ;
1243-
1244- /**
1245- * @return true if the assembly was not written to disk (as the consequence
1246- * of errors, which are visible in ``#diagnostics``)
1247- */
1248- readonly emitSkipped : boolean ;
1249- }
1250-
12511235function _fingerprint ( assembly : spec . Assembly ) : spec . Assembly {
12521236 delete assembly . fingerprint ;
12531237 assembly = sortJson ( assembly ) ;
0 commit comments