From cacf34a4c26de32e054762606a6ee5a42ced3683 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 9 Apr 2015 16:55:42 -0700 Subject: [PATCH] Check for inlineSoruceMaps first --- src/harness/compilerRunner.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/harness/compilerRunner.ts b/src/harness/compilerRunner.ts index 8b4e60f8f6..2845feb75b 100644 --- a/src/harness/compilerRunner.ts +++ b/src/harness/compilerRunner.ts @@ -228,14 +228,17 @@ class CompilerBaselineRunner extends RunnerBase { }); it('Correct Sourcemap output for ' + fileName, () => { - if (options.sourceMap && result.sourceMaps.length !== result.files.length) { - throw new Error('Number of sourcemap files should be same as js files.'); - } - else if (options.inlineSourceMap && result.sourceMaps.length > 0) { - throw new Error('No sourcemap files should be generated if inlineSourceMaps was set.'); + if (options.inlineSourceMap) { + if (result.sourceMaps.length > 0) { + throw new Error('No sourcemap files should be generated if inlineSourceMaps was set.'); + } + return null; } + else if (options.sourceMap) { + if (result.sourceMaps.length !== result.files.length) { + throw new Error('Number of sourcemap files should be same as js files.'); + } - if (options.sourceMap) { Harness.Baseline.runBaseline('Correct Sourcemap output for ' + fileName, justName.replace(/\.ts/, '.js.map'), () => { if (options.noEmitOnError && result.errors.length !== 0 && result.sourceMaps.length === 0) { // We need to return null here or the runBaseLine will actually create a empty file.