mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Add tests for public declarations
This commit is contained in:
committed by
Daniel Rosenwasser
parent
2b4a769dc3
commit
38bf383f03
@@ -776,9 +776,15 @@ module Harness {
|
||||
case 'errortruncation':
|
||||
options.noErrorTruncation = setting.value === 'false';
|
||||
break;
|
||||
|
||||
case 'preserveconstenums':
|
||||
options.preserveConstEnums = setting.value === 'true';
|
||||
break;
|
||||
|
||||
case 'includebuiltfile':
|
||||
inputFiles.push({ unitName: setting.value, content: IO.readFile(libFolder + setting.value)});
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new Error('Unsupported compiler setting ' + setting.flag);
|
||||
}
|
||||
@@ -1164,7 +1170,7 @@ module Harness {
|
||||
var optionRegex = /^[\/]{2}\s*@(\w+)\s*:\s*(\S*)/gm; // multiple matches on multiple lines
|
||||
|
||||
// List of allowed metadata names
|
||||
var fileMetadataNames = ["filename", "comments", "declaration", "module", "nolib", "sourcemap", "target", "out", "outdir", "noemitonerror","noimplicitany", "noresolve", "newline", "newlines", "emitbom", "errortruncation", "usecasesensitivefilenames", "preserveconstenums"];
|
||||
var fileMetadataNames = ["filename", "comments", "declaration", "module", "nolib", "sourcemap", "target", "out", "outdir", "noemitonerror", "noimplicitany", "noresolve", "newline", "newlines", "emitbom", "errortruncation", "usecasesensitivefilenames", "preserveconstenums", "includebuiltfile"];
|
||||
|
||||
function extractCompilerSettings(content: string): CompilerSetting[] {
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
||||
// @includeBuiltFile: typescript.d.ts
|
||||
// @noImplicitAny: true
|
||||
// @target: ES3
|
||||
// @module: CommonJs
|
||||
// @noresolve: true
|
||||
|
||||
import ts = require("typescript");
|
||||
|
||||
var sourceFile = ts.createSourceFile("file1.ts", "var x = 0;", ts.ScriptTarget.Latest, "0.0");
|
||||
|
||||
var program = ts.createProgram(["file1.ts"], {}, undefined);
|
||||
@@ -0,0 +1,7 @@
|
||||
// @includeBuiltFile: typescriptServices.d.ts
|
||||
// @noImplicitAny: true
|
||||
// @target: ES3
|
||||
|
||||
var sourceFile = ts.createSourceFile("file1.ts", "var x = 0;", ts.ScriptTarget.Latest, "0.0");
|
||||
|
||||
var program = ts.createProgram(["file1.ts"], {}, undefined);
|
||||
Reference in New Issue
Block a user