Skip to content

6974 Add compiler flag "--lib" #7452

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 74 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
8e5606e
Separate ES6 library feature-by-feature into smaller files
Feb 6, 2016
44aed7b
Feature-by-feature separate es7 library into smaller files
Feb 6, 2016
cbec78e
Rename core to es5
Feb 6, 2016
73534a4
Update building library files in JakeFile
Feb 9, 2016
00d619d
Separate iterable into its own file
Feb 11, 2016
1609c31
separate symbol into its own file
Feb 11, 2016
eb30193
separate well-known symbol into its own file
Feb 11, 2016
3b15eb0
remove iterable and symbol component from es6.string.d.ts
Feb 11, 2016
2f43778
remove iterable and symbol components from es6.array.d.ts
Feb 11, 2016
41e5b24
remove iterable and symbol components from es6.collection.d.ts
Feb 11, 2016
067fa12
remove symbol components from es6.math.d.ts
Feb 11, 2016
9fa06fd
remove iterable and symbol components from es6.object.d.ts
Feb 11, 2016
5200bf1
remove iterable and symbol components from es6.promise.d.ts
Feb 11, 2016
8616370
remove iterable and symbol component from es6.reflect.d.ts
Feb 11, 2016
16104a2
remove iterable and symbol components from es6.proxy.d.ts
Feb 11, 2016
f19bd4c
split function into its own file
Feb 11, 2016
005271e
split regexp into its own file
Feb 11, 2016
80f6920
remove unused file
Feb 11, 2016
37a7998
rename es7 array-include d.ts file
Feb 11, 2016
69e5045
Include new lib files into compilation
Feb 12, 2016
b461ab8
Move symbol.iterable to symbol.wellknown
Feb 19, 2016
08f1a77
Make iterable depends on symbol
Feb 19, 2016
4684313
Move functions/methods that use propertyKey back to its original inte…
Feb 19, 2016
6043a97
Rename dome.es6 to dom.iterable
Feb 20, 2016
1704059
Rename importcore.d.ts to importes5.d.ts
Feb 20, 2016
779ffe8
Add es6.d.ts and es7.d.ts that contain /// references to their associ…
Feb 20, 2016
8e902c2
Update library compilation
Feb 20, 2016
c33a7ac
Fix harness broken from renaming generated library files
Feb 23, 2016
fc42621
Update baselines
Feb 23, 2016
70f6969
Merge branch 'master' into breakinglibrary
Feb 23, 2016
8e20680
Remove intl.d.ts
Feb 26, 2016
3839898
Use lib.full.es6.d.ts instead of lib.es6.d.ts
Feb 26, 2016
c1290c1
Add intl.d.ts to es5.d.ts
Feb 26, 2016
77639de
Add missing WeakSet and Set to collection
Feb 26, 2016
b41009a
Remove unused RegexpConstructor interface
Feb 26, 2016
23cb32e
Separate generator into its own file
Feb 26, 2016
499b338
Update baselines
Feb 26, 2016
2d2bf11
Merge branch 'master' into breakinglibrary
Feb 26, 2016
4c89068
Update baseline from merging intl.d.ts into es5.d.ts
Feb 27, 2016
5509b48
Update Jakefile
Feb 29, 2016
3f5d374
Remove iterable-iterator dependence
Mar 2, 2016
f052835
Use lower case for lib filename
Mar 2, 2016
92e8f02
Add new command line option, --lib.
Feb 24, 2016
a3741e0
Add unittest for parsing --lib in tsconfig
Mar 5, 2016
e672e5a
Add unittest for command line parsing for --lib
Mar 5, 2016
1e29d9d
Add unittest for command line parsing for --lib
Mar 8, 2016
e3dc816
Change name from --library to --lib
Mar 8, 2016
22d5803
Add compiler baseline tests
Mar 8, 2016
23151a8
Add internal decorator to fix api brokerage
Mar 8, 2016
5f06a4e
Merge branch '6974AddLibFlag' of https://github.com/Microsoft/TypeScr…
Mar 8, 2016
05fe71c
Merge branch 'master' into breakinglibrary
Mar 8, 2016
e5bbdec
Renaming scripthost file
Mar 9, 2016
8167317
Renaming scripthost file
Mar 9, 2016
fbb80ee
Merge branch 'breakinglibrary' of https://github.com/Microsoft/TypeSc…
Mar 9, 2016
eed5020
Merge branch 'breakinglibrary' into 6974AddLibFlag
Mar 9, 2016
3aabcda
Merge branch '6974AddLibFlag' of https://github.com/Microsoft/TypeScr…
Mar 9, 2016
7d31428
Fix baselines from merging with "master"
Mar 9, 2016
0f7732f
Add baseline tests for modularize library
Mar 9, 2016
b053f11
Add baselines for new tests
Mar 9, 2016
812f858
Refactor comment and name
Mar 9, 2016
d09c680
Remove short-name, remove commandlineParsing unittest
Mar 10, 2016
94a4beb
Merge branch 'master' into 6974AddLibFlag
Mar 10, 2016
7083900
Fix broken tests
Mar 10, 2016
a42ac70
Unify caching for library sourcefile in harness
Mar 17, 2016
303fa9c
Remove old baselines
Mar 17, 2016
ad969e3
Merge branch 'master' into 6974AddLibFlag
Mar 17, 2016
24b9c2f
Update unittests to test --lib
Mar 21, 2016
62e4705
Update unittest for testing --lib
Mar 24, 2016
8b8b254
Fix unittest for commandline parsing
Mar 25, 2016
bad10e5
Merge branch 'master' into 6974AddLibFlag
Mar 25, 2016
67fa6cc
Fix help message
Mar 25, 2016
1e732c5
Remove newline on top of the file
Mar 25, 2016
27d308d
Include no-default comment
Mar 25, 2016
f93cc40
Addres PR: change lib filenames from es6 to es2015 and es7 to es2016
Mar 28, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
55 changes: 45 additions & 10 deletions Jakefile.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,18 +165,53 @@ var harnessSources = harnessCoreSources.concat([
return path.join(serverDirectory, f);
}));

var librarySourceMap = [
{ target: "lib.core.d.ts", sources: ["header.d.ts", "core.d.ts"] },
{ target: "lib.dom.d.ts", sources: ["importcore.d.ts", "intl.d.ts", "dom.generated.d.ts"], },
{ target: "lib.webworker.d.ts", sources: ["importcore.d.ts", "intl.d.ts", "webworker.generated.d.ts"], },
{ target: "lib.scriptHost.d.ts", sources: ["importcore.d.ts", "scriptHost.d.ts"], },
{ target: "lib.d.ts", sources: ["header.d.ts", "core.d.ts", "intl.d.ts", "dom.generated.d.ts", "webworker.importscripts.d.ts", "scriptHost.d.ts"], },
{ target: "lib.core.es6.d.ts", sources: ["header.d.ts", "core.d.ts", "es6.d.ts"]},
{ target: "lib.es6.d.ts", sources: ["header.d.ts", "es6.d.ts", "core.d.ts", "intl.d.ts", "dom.generated.d.ts", "dom.es6.d.ts", "webworker.importscripts.d.ts", "scriptHost.d.ts"] },
{ target: "lib.core.es7.d.ts", sources: ["header.d.ts", "core.d.ts", "es6.d.ts", "es7.d.ts"]},
{ target: "lib.es7.d.ts", sources: ["header.d.ts", "es6.d.ts", "es7.d.ts", "core.d.ts", "intl.d.ts", "dom.generated.d.ts", "dom.es6.d.ts", "webworker.importscripts.d.ts", "scriptHost.d.ts"] }
var es2015LibrarySources = [
"es2015.array.d.ts",
"es2015.collection.d.ts",
"es2015.function.d.ts",
"es2015.generator.d.ts",
"es2015.iterable.d.ts",
"es2015.math.d.ts",
"es2015.number.d.ts",
"es2015.object.d.ts",
"es2015.promise.d.ts",
"es2015.proxy.d.ts",
"es2015.reflect.d.ts",
"es2015.regexp.d.ts",
"es2015.string.d.ts",
"es2015.symbol.d.ts",
"es2015.symbol.wellknown.d.ts",
];

var es2015LibrarySourceMap = es2015LibrarySources.map(function(source) {
return { target: "lib." + source, sources: ["header.d.ts", source] };
});

var es2016LibrarySource = [ "es2016.array.include.d.ts" ];

var es2016LibrarySourceMap = es2016LibrarySource.map(function(source) {
return { target: "lib." + source, sources: ["header.d.ts", source] };
})

var hostsLibrarySources = ["dom.generated.d.ts", "webworker.importscripts.d.ts", "scripthost.d.ts"]

var librarySourceMap = [
// Host library
{ target: "lib.dom.d.ts", sources: ["header.d.ts", "dom.generated.d.ts"], },
{ target: "lib.dom.iterable.d.ts", sources: ["header.d.ts", "dom.iterable.d.ts"], },
{ target: "lib.webworker.d.ts", sources: ["header.d.ts", "webworker.generated.d.ts"], },
{ target: "lib.scripthost.d.ts", sources: ["header.d.ts", "scripthost.d.ts"], },

// JavaScript library
{ target: "lib.es5.d.ts", sources: ["header.d.ts", "es5.d.ts"] },
{ target: "lib.es2015.d.ts", sources: ["header.d.ts", "es2015.d.ts"] },
{ target: "lib.es2016.d.ts", sources: ["header.d.ts", "es2016.d.ts"] },

// JavaScript + all host library
{ target: "lib.d.ts", sources: ["header.d.ts", "es5.d.ts"].concat(hostsLibrarySources), },
{ target: "lib.full.es2015.d.ts", sources: ["header.d.ts", "es5.d.ts"].concat(es2015LibrarySources, hostsLibrarySources), },
].concat(es2015LibrarySourceMap, es2016LibrarySourceMap);

var libraryTargets = librarySourceMap.map(function (f) {
return path.join(builtLocalDirectory, f.target);
});
Expand Down
61 changes: 26 additions & 35 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ namespace ts {

const globals: SymbolTable = {};

let globalESSymbolConstructorSymbol: Symbol;
let getGlobalESSymbolConstructorSymbol: () => Symbol;

let getGlobalPromiseConstructorSymbol: () => Symbol;

Expand All @@ -150,11 +150,12 @@ namespace ts {
let globalNumberType: ObjectType;
let globalBooleanType: ObjectType;
let globalRegExpType: ObjectType;
let globalTemplateStringsArrayType: ObjectType;
let globalESSymbolType: ObjectType;
let globalIterableType: GenericType;
let globalIteratorType: GenericType;
let globalIterableIteratorType: GenericType;
let getGlobalTemplateStringsArrayType: () => ObjectType;

let getGlobalESSymbolType: () => ObjectType;
let getGlobalIterableType: () => GenericType;
let getGlobalIteratorType: () => GenericType;
let getGlobalIterableIteratorType: () => GenericType;

let anyArrayType: Type;
let anyReadonlyArrayType: Type;
Expand Down Expand Up @@ -3973,7 +3974,7 @@ namespace ts {
type = globalBooleanType;
}
else if (type.flags & TypeFlags.ESSymbol) {
type = globalESSymbolType;
type = getGlobalESSymbolType();
}
return type;
}
Expand Down Expand Up @@ -4744,10 +4745,6 @@ namespace ts {
return typeSymbol && getDeclaredTypeOfSymbol(typeSymbol);
}

function getGlobalESSymbolConstructorSymbol() {
return globalESSymbolConstructorSymbol || (globalESSymbolConstructorSymbol = getGlobalValueSymbol("Symbol"));
}

/**
* Creates a TypeReference for a generic `TypedPropertyDescriptor<T>`.
*/
Expand All @@ -4766,11 +4763,11 @@ namespace ts {
}

function createIterableType(elementType: Type): Type {
return createTypeFromGenericGlobalType(globalIterableType, [elementType]);
return createTypeFromGenericGlobalType(getGlobalIterableType(), [elementType]);
}

function createIterableIteratorType(elementType: Type): Type {
return createTypeFromGenericGlobalType(globalIterableIteratorType, [elementType]);
return createTypeFromGenericGlobalType(getGlobalIterableIteratorType(), [elementType]);
}

function createArrayType(elementType: Type): Type {
Expand Down Expand Up @@ -10413,7 +10410,7 @@ namespace ts {
return getEffectiveDecoratorArgumentType(<Decorator>node, argIndex);
}
else if (argIndex === 0 && node.kind === SyntaxKind.TaggedTemplateExpression) {
return globalTemplateStringsArrayType;
return getGlobalTemplateStringsArrayType();
}

// This is not a synthetic argument, so we return 'undefined'
Expand Down Expand Up @@ -14177,7 +14174,7 @@ namespace ts {
if (!typeAsIterable.iterableElementType) {
// As an optimization, if the type is instantiated directly using the globalIterableType (Iterable<number>),
// then just grab its type argument.
if ((type.flags & TypeFlags.Reference) && (<GenericType>type).target === globalIterableType) {
if ((type.flags & TypeFlags.Reference) && (<GenericType>type).target === getGlobalIterableType()) {
typeAsIterable.iterableElementType = (<GenericType>type).typeArguments[0];
}
else {
Expand Down Expand Up @@ -14223,7 +14220,7 @@ namespace ts {
if (!typeAsIterator.iteratorElementType) {
// As an optimization, if the type is instantiated directly using the globalIteratorType (Iterator<number>),
// then just grab its type argument.
if ((type.flags & TypeFlags.Reference) && (<GenericType>type).target === globalIteratorType) {
if ((type.flags & TypeFlags.Reference) && (<GenericType>type).target === getGlobalIteratorType()) {
typeAsIterator.iteratorElementType = (<GenericType>type).typeArguments[0];
}
else {
Expand Down Expand Up @@ -14267,7 +14264,7 @@ namespace ts {

// As an optimization, if the type is instantiated directly using the globalIterableIteratorType (IterableIterator<number>),
// then just grab its type argument.
if ((type.flags & TypeFlags.Reference) && (<GenericType>type).target === globalIterableIteratorType) {
if ((type.flags & TypeFlags.Reference) && (<GenericType>type).target === getGlobalIterableIteratorType()) {
return (<GenericType>type).typeArguments[0];
}

Expand Down Expand Up @@ -16877,12 +16874,14 @@ namespace ts {
globalNumberType = getGlobalType("Number");
globalBooleanType = getGlobalType("Boolean");
globalRegExpType = getGlobalType("RegExp");

jsxElementType = getExportedTypeFromNamespace("JSX", JsxNames.Element);
getGlobalClassDecoratorType = memoize(() => getGlobalType("ClassDecorator"));
getGlobalPropertyDecoratorType = memoize(() => getGlobalType("PropertyDecorator"));
getGlobalMethodDecoratorType = memoize(() => getGlobalType("MethodDecorator"));
getGlobalParameterDecoratorType = memoize(() => getGlobalType("ParameterDecorator"));
getGlobalTypedPropertyDescriptorType = memoize(() => getGlobalType("TypedPropertyDescriptor", /*arity*/ 1));
getGlobalESSymbolConstructorSymbol = memoize(() => getGlobalValueSymbol("Symbol"));
getGlobalPromiseType = memoize(() => getGlobalType("Promise", /*arity*/ 1));
tryGetGlobalPromiseType = memoize(() => getGlobalSymbol("Promise", SymbolFlags.Type, /*diagnostic*/ undefined) && getGlobalPromiseType());
getGlobalPromiseLikeType = memoize(() => getGlobalType("PromiseLike", /*arity*/ 1));
Expand All @@ -16891,27 +16890,19 @@ namespace ts {
getGlobalPromiseConstructorLikeType = memoize(() => getGlobalType("PromiseConstructorLike"));
getGlobalThenableType = memoize(createThenableType);

// If we're in ES6 mode, load the TemplateStringsArray.
// Otherwise, default to 'unknown' for the purposes of type checking in LS scenarios.
getGlobalTemplateStringsArrayType = memoize(() => getGlobalType("TemplateStringsArray"));

if (languageVersion >= ScriptTarget.ES6) {
globalTemplateStringsArrayType = getGlobalType("TemplateStringsArray");
globalESSymbolType = getGlobalType("Symbol");
globalESSymbolConstructorSymbol = getGlobalValueSymbol("Symbol");
globalIterableType = <GenericType>getGlobalType("Iterable", /*arity*/ 1);
globalIteratorType = <GenericType>getGlobalType("Iterator", /*arity*/ 1);
globalIterableIteratorType = <GenericType>getGlobalType("IterableIterator", /*arity*/ 1);
getGlobalESSymbolType = memoize(() => getGlobalType("Symbol"));
getGlobalIterableType = memoize(() => <GenericType>getGlobalType("Iterable", /*arity*/ 1));
getGlobalIteratorType = memoize(() => <GenericType>getGlobalType("Iterator", /*arity*/ 1));
getGlobalIterableIteratorType = memoize(() => <GenericType>getGlobalType("IterableIterator", /*arity*/ 1));
}
else {
globalTemplateStringsArrayType = unknownType;

// Consider putting Symbol interface in lib.d.ts. On the plus side, putting it in lib.d.ts would make it
// extensible for Polyfilling Symbols. But putting it into lib.d.ts could also break users that have
// a global Symbol already, particularly if it is a class.
globalESSymbolType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined);
globalESSymbolConstructorSymbol = undefined;
globalIterableType = emptyGenericType;
globalIteratorType = emptyGenericType;
globalIterableIteratorType = emptyGenericType;
getGlobalESSymbolType = memoize(() => emptyObjectType);
getGlobalIterableType = memoize(() => emptyGenericType);
getGlobalIteratorType = memoize(() => emptyGenericType);
getGlobalIterableIteratorType = memoize(() => emptyGenericType);
}

anyArrayType = createArrayType(anyType);
Expand Down
92 changes: 66 additions & 26 deletions src/compiler/commandLineParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ namespace ts {
},
{
name: "pretty",
paramType: Diagnostics.KIND,
description: Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental,
type: "boolean"
},
Expand Down Expand Up @@ -332,6 +331,43 @@ namespace ts {
type: "boolean",
description: Diagnostics.Do_not_emit_use_strict_directives_in_module_output
},
{
name: "lib",
type: "list",
element: {
name: "lib",
type: {
// JavaScript only
"es5": "lib.es5.d.ts",
"es6": "lib.es2015.d.ts",
"es2015": "lib.es2015.d.ts",
"es7": "lib.es2016.d.ts",
"es2016": "lib.es2016.d.ts",
// Host only
"dom": "lib.dom.d.ts",
"webworker": "lib.webworker.d.ts",
"scripthost": "lib.scripthost.d.ts",
// ES2015 Or ESNext By-feature options
"es2015.array": "lib.es2015.array.d.ts",
"es2015.collection": "lib.es2015.collection.d.ts",
"es2015.generator": "lib.es2015.generator.d.ts",
"es2015.function": "lib.es2015.function.d.ts",
"es2015.iterable": "lib.es2015.iterable.d.ts",
"es2015.math": "lib.es2015.math.d.ts",
"es2015.number": "lib.es2015.number.d.ts",
"es2015.object": "lib.es2015.object.d.ts",
"es2015.promise": "lib.es2015.promise.d.ts",
"es2015.proxy": "lib.es2015.proxy.d.ts",
"es2015.reflect": "lib.es2015.reflect.d.ts",
"es2015.regexp": "lib.es2015.regexp.d.ts",
"es2015.string": "lib.es2015.string.d.ts",
"es2015.symbol": "lib.es2015.symbol.d.ts",
"es2015.symbol.wellknown": "lib.es2015.symbol.wellknown.d.ts",
"es2016.array.include": "lib.es2016.array.include.d.ts"
},
},
description: Diagnostics.Specify_library_files_to_be_included_in_the_compilation_Colon
},
{
name: "strictNullChecks",
type: "boolean",
Expand Down Expand Up @@ -370,6 +406,7 @@ namespace ts {
}

let optionNameMapCache: OptionNameMap;

/* @internal */
export function getOptionNameMap(): OptionNameMap {
if (optionNameMapCache) {
Expand Down Expand Up @@ -399,6 +436,32 @@ namespace ts {
return createCompilerDiagnostic(Diagnostics.Argument_for_0_option_must_be_Colon_1, `--${opt.name}`, namesOfType);
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i do not think we need to special case this one. we already have rootDirs that is a list and we special case it. we should just handle a list type as a valid commandline option type.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a semi-working example of what i mean in https://github.com/Microsoft/TypeScript/compare/listOptionParsing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like your approach. Should I try to cherry pick them in here?

/* @internal */
export function parseCustomTypeOption(opt: CommandLineOptionOfCustomType, value: string, errors: Diagnostic[]) {
const key = (value || "").trim().toLowerCase();
const map = opt.type;
if (hasProperty(map, key)) {
return map[key];
}
else {
errors.push(createCompilerDiagnosticForInvalidCustomType(opt));
}
}

/* @internal */
export function parseListTypeOption(opt: CommandLineOptionOfListType, value: string, errors: Diagnostic[]): (string | number)[] {
const values = (value || "").trim().split(",");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So as I mentioned, can you be more tolerant of whitespace around commas?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so it is handling in parseCustomTypeOption by calling trim we allow the following `--lib "es5, es6". I will add tests to make sure we preserve the behaviour

switch (opt.element.type) {
case "number":
return ts.map(values, parseInt);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually never even use "number" in our command line options, and even if we did, should the necessarily be only integers?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What you mean by " should the necessarily be only integers?"

case "string":
return ts.map(values, v => v || "");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When would you have undefined here?

default:
return filter(map(values, v => parseCustomTypeOption(<CommandLineOptionOfCustomType>opt.element, v, errors)), v => !!v);
}
}

/* @internal */
export function parseCommandLine(commandLine: string[], readFile?: (path: string) => string): ParsedCommandLine {
const options: CompilerOptions = {};
const fileNames: string[] = [];
Expand Down Expand Up @@ -453,12 +516,12 @@ namespace ts {
i++;
break;
case "list":
options[opt.name] = parseListTypeOption(<CommandLineOptionOfListType>opt, args[i]);
options[opt.name] = parseListTypeOption(<CommandLineOptionOfListType>opt, args[i], errors);
i++;
break;
// If not a primitive, the possible types are specified in what is effectively a map of options.
default:
options[opt.name] = parseCustomTypeOption(<CommandLineOptionOfCustomType>opt, args[i]);
options[opt.name] = parseCustomTypeOption(<CommandLineOptionOfCustomType>opt, args[i], errors);
i++;
break;
}
Expand All @@ -471,29 +534,6 @@ namespace ts {
else {
fileNames.push(s);
}

function parseCustomTypeOption(opt: CommandLineOptionOfCustomType, value: string) {
const key = (value || "").trim().toLowerCase();
const map = opt.type;
if (hasProperty(map, key)) {
return map[key];
}
else {
errors.push(createCompilerDiagnosticForInvalidCustomType(opt));
}
}

function parseListTypeOption(opt: CommandLineOptionOfListType, value: string): (string | number)[] {
const values = (value || "").trim().split(",");
switch (opt.element.type) {
case "number":
return ts.map(values, parseInt);
case "string":
return ts.map(values, v => v || "");
default:
return filter(map(values, v => parseCustomTypeOption(<CommandLineOptionOfCustomType>opt.element, v)), v => !!v);
}
}
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/compiler/diagnosticMessages.json
Original file line number Diff line number Diff line change
Expand Up @@ -2488,6 +2488,10 @@
"category": "Message",
"code": 6078
},
"Specify library files to be included in the compilation: ": {
"category": "Message",
"code": 6079
},
"Specify JSX code generation: 'preserve' or 'react'": {
"category": "Message",
"code": 6080
Expand Down
Loading