Skip to content
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

Api review cleanup #2692

Merged
merged 10 commits into from
Apr 11, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 14 additions & 60 deletions Jakefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,24 +105,6 @@ var serverSources = [
return path.join(serverDirectory, f);
});

var definitionsRoots = [
"compiler/types.d.ts",
"compiler/scanner.d.ts",
"compiler/parser.d.ts",
"compiler/checker.d.ts",
"compiler/program.d.ts",
"compiler/commandLineParser.d.ts",
"services/services.d.ts",
];

var internalDefinitionsRoots = [
"compiler/core.d.ts",
"compiler/sys.d.ts",
"compiler/utilities.d.ts",
"compiler/commandLineParser.d.ts",
"services/utilities.d.ts",
];

var harnessSources = [
"harness.ts",
"sourceMapRecorder.ts",
Expand Down Expand Up @@ -354,60 +336,32 @@ var tscFile = path.join(builtLocalDirectory, compilerFilename);
compileFile(tscFile, compilerSources, [builtLocalDirectory, copyright].concat(compilerSources), [copyright], /*useBuiltCompiler:*/ false);

var servicesFile = path.join(builtLocalDirectory, "typescriptServices.js");
var standaloneDefinitionsFile = path.join(builtLocalDirectory, "typescriptServices.d.ts");
var nodePackageFile = path.join(builtLocalDirectory, "typescript.js");
var nodeDefinitionsFile = path.join(builtLocalDirectory, "typescript.d.ts");

compileFile(servicesFile, servicesSources,[builtLocalDirectory, copyright].concat(servicesSources),
/*prefixes*/ [copyright],
/*useBuiltCompiler*/ true,
/*noOutFile*/ false,
/*generateDeclarations*/ false,
/*generateDeclarations*/ true,
/*outDir*/ undefined,
/*preserveConstEnums*/ true,
/*keepComments*/ false,
/*keepComments*/ true,
/*noResolve*/ false,
/*stripInternal*/ false,
/*stripInternal*/ true,
/*callback*/ function () {
jake.cpR(servicesFile, nodePackageFile, {silent: true});
});

var nodeDefinitionsFile = path.join(builtLocalDirectory, "typescript.d.ts");
var standaloneDefinitionsFile = path.join(builtLocalDirectory, "typescriptServices.d.ts");
var internalNodeDefinitionsFile = path.join(builtLocalDirectory, "typescript_internal.d.ts");
var internalStandaloneDefinitionsFile = path.join(builtLocalDirectory, "typescriptServices_internal.d.ts");
var tempDirPath = path.join(builtLocalDirectory, "temptempdir");
compileFile(nodeDefinitionsFile, servicesSources,[builtLocalDirectory, copyright].concat(servicesSources),
/*prefixes*/ undefined,
/*useBuiltCompiler*/ true,
/*noOutFile*/ true,
/*generateDeclarations*/ true,
/*outDir*/ tempDirPath,
/*preserveConstEnums*/ true,
/*keepComments*/ true,
/*noResolve*/ true,
/*stripInternal*/ true,
/*callback*/ function () {
function makeDefinitionFiles(definitionsRoots, standaloneDefinitionsFile, nodeDefinitionsFile) {
// Create the standalone definition file
concatenateFiles(standaloneDefinitionsFile, definitionsRoots.map(function (f) {
return path.join(tempDirPath, f);
}));
prependFile(copyright, standaloneDefinitionsFile);

// Create the node definition file by replacing 'ts' module with '"typescript"' as a module.
jake.cpR(standaloneDefinitionsFile, nodeDefinitionsFile, {silent: true});
var definitionFileContents = fs.readFileSync(nodeDefinitionsFile).toString();
definitionFileContents = definitionFileContents.replace(/declare module ts/g, 'declare module "typescript"');
fs.writeFileSync(nodeDefinitionsFile, definitionFileContents);
}
prependFile(copyright, standaloneDefinitionsFile);

// Create the public definition files
makeDefinitionFiles(definitionsRoots, standaloneDefinitionsFile, nodeDefinitionsFile);

// Create the internal definition files
makeDefinitionFiles(internalDefinitionsRoots, internalStandaloneDefinitionsFile, internalNodeDefinitionsFile);
// Create the node definition file by replacing 'ts' module with '"typescript"' as a module.
jake.cpR(standaloneDefinitionsFile, nodeDefinitionsFile, {silent: true});
var definitionFileContents = fs.readFileSync(nodeDefinitionsFile).toString();
definitionFileContents = definitionFileContents.replace(/declare module ts/g, 'declare module "typescript"');
fs.writeFileSync(nodeDefinitionsFile, definitionFileContents);
});

// Delete the temp dir
jake.rmRf(tempDirPath, {silent: true});
});

var serverFile = path.join(builtLocalDirectory, "tsserver.js");
compileFile(serverFile, serverSources,[builtLocalDirectory, copyright].concat(serverSources), /*prefixes*/ [copyright], /*useBuiltCompiler*/ true);
Expand Down Expand Up @@ -469,7 +423,7 @@ task("generate-spec", [specMd])
// Makes a new LKG. This target does not build anything, but errors if not all the outputs are present in the built/local directory
desc("Makes a new LKG out of the built js files");
task("LKG", ["clean", "release", "local"].concat(libraryTargets), function() {
var expectedFiles = [tscFile, servicesFile, serverFile, nodePackageFile, nodeDefinitionsFile, standaloneDefinitionsFile, internalNodeDefinitionsFile, internalStandaloneDefinitionsFile].concat(libraryTargets);
var expectedFiles = [tscFile, servicesFile, serverFile, nodePackageFile, nodeDefinitionsFile, standaloneDefinitionsFile].concat(libraryTargets);
var missingFiles = expectedFiles.filter(function (f) {
return !fs.existsSync(f);
});
Expand Down
4 changes: 2 additions & 2 deletions bin/lib.core.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ interface RegExp {
*/
test(string: string): boolean;

/** Returns a copy of the text of the regular expression pattern. Read-only. The rgExp argument is a Regular expression object. It can be a variable name or a literal. */
/** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */
source: string;

/** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */
Expand Down Expand Up @@ -1183,4 +1183,4 @@ interface TypedPropertyDescriptor<T> {
declare type ClassDecorator = <TFunction extends Function>(target: TFunction) => TFunction | void;
declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void;
declare type MethodDecorator = <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;
declare type ParameterDecorator = (target: Function, propertyKey: string | symbol, parameterIndex: number) => void;
declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void;
71 changes: 39 additions & 32 deletions bin/lib.core.es6.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ interface RegExp {
*/
test(string: string): boolean;

/** Returns a copy of the text of the regular expression pattern. Read-only. The rgExp argument is a Regular expression object. It can be a variable name or a literal. */
/** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */
source: string;

/** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */
Expand Down Expand Up @@ -1183,7 +1183,7 @@ interface TypedPropertyDescriptor<T> {
declare type ClassDecorator = <TFunction extends Function>(target: TFunction) => TFunction | void;
declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void;
declare type MethodDecorator = <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;
declare type ParameterDecorator = (target: Function, propertyKey: string | symbol, parameterIndex: number) => void;
declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void;
declare type PropertyKey = string | number | symbol;

interface Symbol {
Expand Down Expand Up @@ -1236,26 +1236,21 @@ interface SymbolConstructor {
*/
isConcatSpreadable: symbol;

/**
* A Boolean value that if true indicates that an object may be used as a regular expression.
*/
isRegExp: symbol;

/**
* A method that returns the default iterator for an object.Called by the semantics of the
* for-of statement.
* for-of statement.
*/
iterator: symbol;

/**
* A method that converts an object to a corresponding primitive value.Called by the ToPrimitive
* abstract operation.
* abstract operation.
*/
toPrimitive: symbol;

/**
* A String value that is used in the creation of the default string description of an object.
* Called by the built- in method Object.prototype.toString.
* A String value that is used in the creation of the default string description of an object.
* Called by the built-in method Object.prototype.toString.
*/
toStringTag: symbol;

Expand Down Expand Up @@ -1297,7 +1292,7 @@ interface ObjectConstructor {
getOwnPropertySymbols(o: any): symbol[];

/**
* Returns true if the values are the same value, false otherwise.
* Returns true if the values are the same value, false otherwise.
* @param value1 The first value.
* @param value2 The second value.
*/
Expand Down Expand Up @@ -1784,8 +1779,6 @@ interface Math {
}

interface RegExp {
[Symbol.isRegExp]: boolean;

/**
* Matches a string with a regular expression, and returns an array containing the results of
* that search.
Expand Down Expand Up @@ -1817,6 +1810,20 @@ interface RegExp {
*/
split(string: string, limit?: number): string[];

/**
* Returns a string indicating the flags of the regular expression in question. This field is read-only.
* The characters in this string are sequenced and concatenated in the following order:
*
* - "g" for global
* - "i" for ignoreCase
* - "m" for multiline
* - "u" for unicode
* - "y" for sticky
*
* If no flags are set, the value is the empty string.
*/
flags: string;

/**
* Returns a Boolean value indicating the state of the sticky flag (y) used with a regular
* expression. Default is false. Read-only.
Expand Down Expand Up @@ -4699,27 +4706,27 @@ interface ProxyHandler<T> {

interface ProxyConstructor {
revocable<T>(target: T, handler: ProxyHandler<T>): { proxy: T; revoke: () => void; };
new <T>(target: T, handeler: ProxyHandler<T>): T
new <T>(target: T, handler: ProxyHandler<T>): T
}
declare var Proxy: ProxyConstructor;

declare var Reflect: {
apply(target: Function, thisArgument: any, argumentsList: ArrayLike<any>): any;
construct(target: Function, argumentsList: ArrayLike<any>): any;
defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean;
deleteProperty(target: any, propertyKey: PropertyKey): boolean;
enumerate(target: any): IterableIterator<any>;
get(target: any, propertyKey: PropertyKey, receiver?: any): any;
getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor;
getPrototypeOf(target: any): any;
has(target: any, propertyKey: string): boolean;
has(target: any, propertyKey: symbol): boolean;
isExtensible(target: any): boolean;
ownKeys(target: any): Array<PropertyKey>;
preventExtensions(target: any): boolean;
set(target: any, propertyKey: PropertyKey, value: any, receiver? :any): boolean;
setPrototypeOf(target: any, proto: any): boolean;
};
declare module Reflect {
function apply(target: Function, thisArgument: any, argumentsList: ArrayLike<any>): any;
function construct(target: Function, argumentsList: ArrayLike<any>): any;
function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean;
function deleteProperty(target: any, propertyKey: PropertyKey): boolean;
function enumerate(target: any): IterableIterator<any>;
function get(target: any, propertyKey: PropertyKey, receiver?: any): any;
function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor;
function getPrototypeOf(target: any): any;
function has(target: any, propertyKey: string): boolean;
function has(target: any, propertyKey: symbol): boolean;
function isExtensible(target: any): boolean;
function ownKeys(target: any): Array<PropertyKey>;
function preventExtensions(target: any): boolean;
function set(target: any, propertyKey: PropertyKey, value: any, receiver? :any): boolean;
function setPrototypeOf(target: any, proto: any): boolean;
}

/**
* Represents the completion of an asynchronous operation
Expand Down
4 changes: 2 additions & 2 deletions bin/lib.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ interface RegExp {
*/
test(string: string): boolean;

/** Returns a copy of the text of the regular expression pattern. Read-only. The rgExp argument is a Regular expression object. It can be a variable name or a literal. */
/** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */
source: string;

/** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */
Expand Down Expand Up @@ -1183,7 +1183,7 @@ interface TypedPropertyDescriptor<T> {
declare type ClassDecorator = <TFunction extends Function>(target: TFunction) => TFunction | void;
declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void;
declare type MethodDecorator = <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;
declare type ParameterDecorator = (target: Function, propertyKey: string | symbol, parameterIndex: number) => void;
declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void;

/////////////////////////////
/// IE10 ECMAScript Extensions
Expand Down
Loading