()
| 4116 | } |
| 4117 | |
| 4118 | compile(): NativeCompilerIR.Base[] { |
| 4119 | try { |
| 4120 | const initFunctionName = this.allocateFunctionName(`${this.moduleName}__module_init__`); |
| 4121 | |
| 4122 | this.processSourceFile(initFunctionName, this.sourceFile); |
| 4123 | return this.moduleBuilder.finalize(initFunctionName, this.options); |
| 4124 | } catch (exc: any) { |
| 4125 | if (!(exc instanceof NativeHelper.NativeCompilerError)) { |
| 4126 | if (this.lastProcessingDeclaration) { |
| 4127 | // Decorate error with last processing declaration |
| 4128 | try { |
| 4129 | const resolvedError = new NativeHelper.NativeCompilerError( |
| 4130 | this.filePath, |
| 4131 | this.sourceFile, |
| 4132 | this.lastProcessingDeclaration, |
| 4133 | exc.message, |
| 4134 | ); |
| 4135 | |
| 4136 | resolvedError.stack = exc.stack; |
| 4137 | |
| 4138 | throw resolvedError; |
| 4139 | } catch (e: any) { |
| 4140 | throw exc; |
| 4141 | } |
| 4142 | } else { |
| 4143 | throw exc; |
| 4144 | } |
| 4145 | } else { |
| 4146 | throw exc; |
| 4147 | } |
| 4148 | } |
| 4149 | } |
| 4150 | } |
| 4151 | |
| 4152 | export function compileIRsToC( |
no test coverage detected