Merge branch 'master' into tscJsFilesxt

This commit is contained in:
Sheetal Nandi
2015-09-21 15:50:39 -07:00
49 changed files with 1393 additions and 508 deletions
+2 -1
View File
@@ -18,7 +18,7 @@ tests/services/browser/typescriptServices.js
scripts/configureNightly.js
scripts/processDiagnosticMessages.d.ts
scripts/processDiagnosticMessages.js
scripts/importDefinitelyTypedTests.js
scripts/importDefinitelyTypedTests/importDefinitelyTypedTests.js
src/harness/*.js
rwc-report.html
*.swp
@@ -35,6 +35,7 @@ scripts/run.bat
scripts/word2md.js
scripts/ior.js
scripts/*.js.map
scripts/typings/
coverage/
internal/
**/.DS_Store
+33 -4
View File
@@ -206,6 +206,9 @@ function concatenateFiles(destinationFile, sourceFiles) {
var useDebugMode = true;
var host = (process.env.host || process.env.TYPESCRIPT_HOST || "node");
var compilerFilename = "tsc.js";
var LKGCompiler = path.join(LKGDirectory, compilerFilename);
var builtLocalCompiler = path.join(builtLocalDirectory, compilerFilename);
/* Compiles a file from a list of sources
* @param outFile: the target file name
* @param sources: an array of the names of the source files
@@ -220,7 +223,7 @@ var compilerFilename = "tsc.js";
*/
function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOutFile, generateDeclarations, outDir, preserveConstEnums, keepComments, noResolve, stripInternal, callback) {
file(outFile, prereqs, function() {
var dir = useBuiltCompiler ? builtLocalDirectory : LKGDirectory;
var compilerPath = useBuiltCompiler ? builtLocalCompiler : LKGCompiler;
var options = "--module commonjs --noImplicitAny --noEmitOnError";
// Keep comments when specifically requested
@@ -257,7 +260,7 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOu
options += " --stripInternal"
}
var cmd = host + " " + dir + compilerFilename + " " + options + " ";
var cmd = host + " " + compilerPath + " " + options + " ";
cmd = cmd + sources.join(" ");
console.log(cmd + "\n");
@@ -328,7 +331,7 @@ compileFile(processDiagnosticMessagesJs,
// The generated diagnostics map; built for the compiler and for the 'generate-diagnostics' task
file(diagnosticInfoMapTs, [processDiagnosticMessagesJs, diagnosticMessagesJson], function () {
var cmd = "node " + processDiagnosticMessagesJs + " " + diagnosticMessagesJson;
var cmd = host + " " + processDiagnosticMessagesJs + " " + diagnosticMessagesJson;
console.log(cmd);
var ex = jake.createExec([cmd]);
// Add listeners for output and error
@@ -374,7 +377,7 @@ task("setDebugMode", function() {
});
task("configure-nightly", [configureNightlyJs], function() {
var cmd = "node " + configureNightlyJs + " " + packageJson + " " + programTs;
var cmd = host + " " + configureNightlyJs + " " + packageJson + " " + programTs;
console.log(cmd);
exec(cmd);
}, { async: true });
@@ -386,6 +389,32 @@ task("publish-nightly", ["configure-nightly", "LKG", "clean", "setDebugMode", "r
exec(cmd);
});
var scriptsTsdJson = path.join(scriptsDirectory, "tsd.json");
file(scriptsTsdJson);
task("tsd-scripts", [scriptsTsdJson], function () {
var cmd = "tsd --config " + scriptsTsdJson + " install";
console.log(cmd)
exec(cmd);
}, { async: true })
var importDefinitelyTypedTestsDirectory = path.join(scriptsDirectory, "importDefinitelyTypedTests");
var importDefinitelyTypedTestsJs = path.join(importDefinitelyTypedTestsDirectory, "importDefinitelyTypedTests.js");
var importDefinitelyTypedTestsTs = path.join(importDefinitelyTypedTestsDirectory, "importDefinitelyTypedTests.ts");
file(importDefinitelyTypedTestsTs);
file(importDefinitelyTypedTestsJs, ["tsd-scripts", importDefinitelyTypedTestsTs], function () {
var cmd = host + " " + LKGCompiler + " -p " + importDefinitelyTypedTestsDirectory;
console.log(cmd);
exec(cmd);
}, { async: true });
task("importDefinitelyTypedTests", [importDefinitelyTypedTestsJs], function () {
var cmd = host + " " + importDefinitelyTypedTestsJs + " ./ ../DefinitelyTyped";
console.log(cmd);
exec(cmd);
}, { async: true });
// Local target to build the compiler and services
var tscFile = path.join(builtLocalDirectory, compilerFilename);
compileFile(tscFile, compilerSources, [builtLocalDirectory, copyright].concat(compilerSources), [copyright], /*useBuiltCompiler:*/ false);
+1 -1
View File
@@ -30,7 +30,7 @@ There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob
* Engage with other TypeScript users and developers on [StackOverflow](http://stackoverflow.com/questions/tagged/typescript).
* Join the [#typescript](http://twitter.com/#!/search/realtime/%23typescript) discussion on Twitter.
* [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md).
* Read the language specification ([docx](http://go.microsoft.com/fwlink/?LinkId=267121), [pdf](http://go.microsoft.com/fwlink/?LinkId=267238)).
* Read the language specification ([docx](https://github.com/Microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification.docx?raw=true), [pdf](https://github.com/Microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification.pdf?raw=true), [md](https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md)).
## Documentation
+28 -1
View File
@@ -3965,7 +3965,34 @@ interface ObjectConstructor {
* Copy the values of all of the enumerable own properties from one or more source objects to a
* target object. Returns the target object.
* @param target The target object to copy to.
* @param sources One or more source objects to copy properties from.
* @param source The source object from which to copy properties.
*/
assign<T, U>(target: T, source: U): T & U;
/**
* Copy the values of all of the enumerable own properties from one or more source objects to a
* target object. Returns the target object.
* @param target The target object to copy to.
* @param source1 The first source object from which to copy properties.
* @param source2 The second source object from which to copy properties.
*/
assign<T, U, V>(target: T, source1: U, source2: V): T & U & V;
/**
* Copy the values of all of the enumerable own properties from one or more source objects to a
* target object. Returns the target object.
* @param target The target object to copy to.
* @param source1 The first source object from which to copy properties.
* @param source2 The second source object from which to copy properties.
* @param source3 The third source object from which to copy properties.
*/
assign<T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
/**
* Copy the values of all of the enumerable own properties from one or more source objects to a
* target object. Returns the target object.
* @param target The target object to copy to.
* @param sources One or more source objects from which to copy properties
*/
assign(target: any, ...sources: any[]): any;
+2 -2
View File
@@ -3881,7 +3881,7 @@ declare module Intl {
currency?: string;
currencyDisplay?: string;
useGrouping?: boolean;
minimumintegerDigits?: number;
minimumIntegerDigits?: number;
minimumFractionDigits?: number;
maximumFractionDigits?: number;
minimumSignificantDigits?: number;
@@ -3894,7 +3894,7 @@ declare module Intl {
style: string;
currency?: string;
currencyDisplay?: string;
minimumintegerDigits: number;
minimumIntegerDigits: number;
minimumFractionDigits: number;
maximumFractionDigits: number;
minimumSignificantDigits?: number;
+2 -2
View File
@@ -57,7 +57,7 @@ declare module Intl {
currency?: string;
currencyDisplay?: string;
useGrouping?: boolean;
minimumintegerDigits?: number;
minimumIntegerDigits?: number;
minimumFractionDigits?: number;
maximumFractionDigits?: number;
minimumSignificantDigits?: number;
@@ -70,7 +70,7 @@ declare module Intl {
style: string;
currency?: string;
currencyDisplay?: string;
minimumintegerDigits: number;
minimumIntegerDigits: number;
minimumFractionDigits: number;
maximumFractionDigits: number;
minimumSignificantDigits?: number;
+30 -3
View File
@@ -3965,7 +3965,34 @@ interface ObjectConstructor {
* Copy the values of all of the enumerable own properties from one or more source objects to a
* target object. Returns the target object.
* @param target The target object to copy to.
* @param sources One or more source objects to copy properties from.
* @param source The source object from which to copy properties.
*/
assign<T, U>(target: T, source: U): T & U;
/**
* Copy the values of all of the enumerable own properties from one or more source objects to a
* target object. Returns the target object.
* @param target The target object to copy to.
* @param source1 The first source object from which to copy properties.
* @param source2 The second source object from which to copy properties.
*/
assign<T, U, V>(target: T, source1: U, source2: V): T & U & V;
/**
* Copy the values of all of the enumerable own properties from one or more source objects to a
* target object. Returns the target object.
* @param target The target object to copy to.
* @param source1 The first source object from which to copy properties.
* @param source2 The second source object from which to copy properties.
* @param source3 The third source object from which to copy properties.
*/
assign<T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
/**
* Copy the values of all of the enumerable own properties from one or more source objects to a
* target object. Returns the target object.
* @param target The target object to copy to.
* @param sources One or more source objects from which to copy properties
*/
assign(target: any, ...sources: any[]): any;
@@ -5169,7 +5196,7 @@ declare module Intl {
currency?: string;
currencyDisplay?: string;
useGrouping?: boolean;
minimumintegerDigits?: number;
minimumIntegerDigits?: number;
minimumFractionDigits?: number;
maximumFractionDigits?: number;
minimumSignificantDigits?: number;
@@ -5182,7 +5209,7 @@ declare module Intl {
style: string;
currency?: string;
currencyDisplay?: string;
minimumintegerDigits: number;
minimumIntegerDigits: number;
minimumFractionDigits: number;
maximumFractionDigits: number;
minimumSignificantDigits?: number;
+2 -2
View File
@@ -57,7 +57,7 @@ declare module Intl {
currency?: string;
currencyDisplay?: string;
useGrouping?: boolean;
minimumintegerDigits?: number;
minimumIntegerDigits?: number;
minimumFractionDigits?: number;
maximumFractionDigits?: number;
minimumSignificantDigits?: number;
@@ -70,7 +70,7 @@ declare module Intl {
style: string;
currency?: string;
currencyDisplay?: string;
minimumintegerDigits: number;
minimumIntegerDigits: number;
minimumFractionDigits: number;
maximumFractionDigits: number;
minimumSignificantDigits?: number;
+11 -138
View File
@@ -47,7 +47,6 @@ var ts;
})(ts.DiagnosticCategory || (ts.DiagnosticCategory = {}));
var DiagnosticCategory = ts.DiagnosticCategory;
})(ts || (ts = {}));
/// <reference path="types.ts"/>
var ts;
(function (ts) {
function createFileMap(getCanonicalFileName) {
@@ -569,9 +568,6 @@ var ts;
}
ts.getNormalizedPathFromPathComponents = getNormalizedPathFromPathComponents;
function getNormalizedPathComponentsOfUrl(url) {
// Get root length of http://www.website.com/folder1/foler2/
// In this example the root is: http://www.website.com/
// normalized path components should be ["http://www.website.com/", "folder1", "folder2"]
var urlLength = url.length;
var rootLength = url.indexOf("://") + "://".length;
while (rootLength < urlLength) {
@@ -731,7 +727,6 @@ var ts;
Debug.fail = fail;
})(Debug = ts.Debug || (ts.Debug = {}));
})(ts || (ts = {}));
/// <reference path="core.ts"/>
var ts;
(function (ts) {
ts.sys = (function () {
@@ -1003,7 +998,6 @@ var ts;
}
})();
})(ts || (ts = {}));
/// <reference path="types.ts" />
var ts;
(function (ts) {
ts.Diagnostics = {
@@ -1624,8 +1618,6 @@ var ts;
A_constructor_cannot_contain_a_super_call_when_its_class_extends_null: { code: 17005, category: ts.DiagnosticCategory.Error, key: "A constructor cannot contain a 'super' call when its class extends 'null'" }
};
})(ts || (ts = {}));
/// <reference path="core.ts"/>
/// <reference path="diagnosticInformationMap.generated.ts"/>
var ts;
(function (ts) {
function tokenIsIdentifierOrKeyword(token) {
@@ -1879,16 +1871,6 @@ var ts;
}
ts.isWhiteSpace = isWhiteSpace;
function isLineBreak(ch) {
// ES5 7.3:
// The ECMAScript line terminator characters are listed in Table 3.
// Table 3: Line Terminator Characters
// Code Unit Value Name Formal Name
// \u000A Line Feed <LF>
// \u000D Carriage Return <CR>
// \u2028 Line separator <LS>
// \u2029 Paragraph separator <PS>
// Only the characters in Table 3 are treated as line terminators. Other new line or line
// breaking characters are treated as white space but not as line terminators.
return ch === 10 ||
ch === 13 ||
ch === 8232 ||
@@ -2990,7 +2972,6 @@ var ts;
}
ts.createScanner = createScanner;
})(ts || (ts = {}));
/// <reference path="parser.ts"/>
var ts;
(function (ts) {
ts.bindTime = 0;
@@ -3704,7 +3685,6 @@ var ts;
}
}
})(ts || (ts = {}));
/// <reference path="binder.ts" />
var ts;
(function (ts) {
function getDeclarationOfKind(symbol, kind) {
@@ -5653,8 +5633,6 @@ var ts;
}
ts.getTypeParameterOwner = getTypeParameterOwner;
})(ts || (ts = {}));
/// <reference path="scanner.ts"/>
/// <reference path="utilities.ts"/>
var ts;
(function (ts) {
var nodeConstructors = new Array(270);
@@ -6145,10 +6123,6 @@ var ts;
}
}
function fixupParentReferences(sourceFile) {
// normally parent references are set during binding. However, for clients that only need
// a syntax tree, and no semantic features, then the binding process is an unnecessary
// overhead. This functions allows us to set all the parents, without all the expense of
// binding.
var parent = sourceFile;
forEachChild(sourceFile, visitNode);
return;
@@ -7480,9 +7454,6 @@ var ts;
return allowInAnd(parseExpression);
}
function parseExpression() {
// Expression[in]:
// AssignmentExpression[in]
// Expression[in] , AssignmentExpression[in]
var saveDecoratorContext = inDecoratorContext();
if (saveDecoratorContext) {
setDecoratorContext(false);
@@ -7507,15 +7478,6 @@ var ts;
return parseAssignmentExpressionOrHigher();
}
function parseAssignmentExpressionOrHigher() {
// AssignmentExpression[in,yield]:
// 1) ConditionalExpression[?in,?yield]
// 2) LeftHandSideExpression = AssignmentExpression[?in,?yield]
// 3) LeftHandSideExpression AssignmentOperator AssignmentExpression[?in,?yield]
// 4) ArrowFunctionExpression[?in,?yield]
// 5) [+Yield] YieldExpression[?In]
//
// Note: for ease of implementation we treat productions '2' and '3' as the same thing.
// (i.e. they're both BinaryExpressions with an assignment operator in it).
if (isYieldExpression()) {
return parseYieldExpression();
}
@@ -8484,8 +8446,6 @@ var ts;
return finishNode(node);
}
function parseThrowStatement() {
// ThrowStatement[Yield] :
// throw [no LineTerminator here]Expression[In, ?Yield];
var node = createNode(206);
parseExpected(96);
node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression);
@@ -9097,8 +9057,6 @@ var ts;
return finishNode(node);
}
function parseHeritageClauses(isClassHeritageClause) {
// ClassTail[Yield,Await] : (Modified) See 14.5
// ClassHeritage[?Yield,?Await]opt { ClassBody[?Yield,?Await]opt }
if (isHeritageClause()) {
return parseList(20, parseHeritageClause);
}
@@ -9265,12 +9223,6 @@ var ts;
return finishNode(importDeclaration);
}
function parseImportClause(identifier, fullStart) {
// ImportClause:
// ImportedDefaultBinding
// NameSpaceImport
// NamedImports
// ImportedDefaultBinding, NameSpaceImport
// ImportedDefaultBinding, NamedImports
var importClause = createNode(221, fullStart);
if (identifier) {
importClause.name = identifier;
@@ -10227,7 +10179,6 @@ var ts;
}
})(IncrementalParser || (IncrementalParser = {}));
})(ts || (ts = {}));
/// <reference path="binder.ts"/>
var ts;
(function (ts) {
var nextSymbolId = 1;
@@ -15562,8 +15513,8 @@ var ts;
}
}
function getContextuallyTypedParameterType(parameter) {
if (isFunctionExpressionOrArrowFunction(parameter.parent)) {
var func = parameter.parent;
var func = parameter.parent;
if (isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) {
if (isContextSensitive(func)) {
var contextualSignature = getContextualSignature(func);
if (contextualSignature) {
@@ -18126,10 +18077,6 @@ var ts;
}
}
function checkParameter(node) {
// Grammar checking
// It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs as the
// Identifier in a PropertySetParameterList of a PropertyAssignment that is contained in strict code
// or if its FunctionBody is strict code(11.1.5).
checkGrammarDecorators(node) || checkGrammarModifiers(node);
checkVariableLikeDeclaration(node);
var func = ts.getContainingFunction(node);
@@ -18772,15 +18719,6 @@ var ts;
return type;
}
function getPromisedType(promise) {
//
// { // promise
// then( // thenFunction
// onfulfilled: ( // onfulfilledParameterType
// value: T // valueParameterType
// ) => any
// ): any;
// }
//
if (promise.flags & 1) {
return undefined;
}
@@ -19123,9 +19061,6 @@ var ts;
}
}
function checkVarDeclaredNamesNotShadowed(node) {
// - ScriptBody : StatementList
// It is a Syntax Error if any element of the LexicallyDeclaredNames of StatementList
// also occurs in the VarDeclaredNames of StatementList.
if ((ts.getCombinedNodeFlags(node) & 49152) !== 0 || ts.isParameterDeclaration(node)) {
return;
}
@@ -19801,19 +19736,6 @@ var ts;
return ts.forEach(symbol.declarations, function (d) { return ts.isClassLike(d) ? d : undefined; });
}
function checkKindsOfPropertyMemberOverrides(type, baseType) {
// TypeScript 1.0 spec (April 2014): 8.2.3
// A derived class inherits all members from its base class it doesn't override.
// Inheritance means that a derived class implicitly contains all non - overridden members of the base class.
// Both public and private property members are inherited, but only public property members can be overridden.
// A property member in a derived class is said to override a property member in a base class
// when the derived class property member has the same name and kind(instance or static)
// as the base class property member.
// The type of an overriding property member must be assignable(section 3.8.4)
// to the type of the overridden property member, or otherwise a compile - time error occurs.
// Base class instance member functions can be overridden by derived class instance member functions,
// but not by other kinds of members.
// Base class instance member variables and accessors can be overridden by
// derived class instance member variables and accessors, but not by other kinds of members.
var baseProperties = getPropertiesOfObjectType(baseType);
for (var _i = 0; _i < baseProperties.length; _i++) {
var baseProperty = baseProperties[_i];
@@ -22347,7 +22269,6 @@ var ts;
}
ts.createTypeChecker = createTypeChecker;
})(ts || (ts = {}));
/// <reference path="checker.ts"/>
var ts;
(function (ts) {
function getDeclarationDiagnostics(host, resolver, targetSourceFile) {
@@ -23675,8 +23596,6 @@ var ts;
}
ts.writeDeclarationFile = writeDeclarationFile;
})(ts || (ts = {}));
/// <reference path="checker.ts"/>
/// <reference path="declarationEmitter.ts"/>
var ts;
(function (ts) {
function isExternalModuleOrDeclarationFile(sourceFile) {
@@ -24416,19 +24335,6 @@ var ts;
write(")");
}
function shouldEmitTemplateHead() {
// If this expression has an empty head literal and the first template span has a non-empty
// literal, then emitting the empty head literal is not necessary.
// `${ foo } and ${ bar }`
// can be emitted as
// foo + " and " + bar
// This is because it is only required that one of the first two operands in the emit
// output must be a string literal, so that the other operand and all following operands
// are forced into strings.
//
// If the first template span has an empty literal, then the head must still be emitted.
// `${ foo }${ bar }`
// must still be emitted as
// "" + foo + bar
ts.Debug.assert(node.templateSpans.length !== 0);
return node.head.text.length !== 0 || node.templateSpans[0].literal.text.length === 0;
}
@@ -24775,8 +24681,15 @@ var ts;
}
else if (declaration.kind === 224) {
write(getGeneratedNameForNode(declaration.parent.parent.parent));
write(".");
writeTextOfNode(currentSourceFile, declaration.propertyName || declaration.name);
var name = declaration.propertyName || declaration.name;
var identifier = ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, name);
if (languageVersion === 0 && identifier === "default") {
write("[\"default\"]");
}
else {
write(".");
write(identifier);
}
return;
}
}
@@ -25769,26 +25682,6 @@ var ts;
emitEmbeddedStatement(node.statement);
}
function emitDownLevelForOfStatement(node) {
// The following ES6 code:
//
// for (let v of expr) { }
//
// should be emitted as
//
// for (let _i = 0, _a = expr; _i < _a.length; _i++) {
// let v = _a[_i];
// }
//
// where _a and _i are temps emitted to capture the RHS and the counter,
// respectively.
// When the left hand side is an expression instead of a let declaration,
// the "let v" is not emitted.
// When the left hand side is a let/const, the v is renamed if there is
// another v in scope.
// Note that all assignments to the LHS are emitted in the body, including
// all destructuring.
// Note also that because an extra statement is needed to assign to the LHS,
// for-of bodies are always emitted as blocks.
var endPos = emitToken(84, node.pos);
write(" ");
endPos = emitToken(17, endPos);
@@ -28519,17 +28412,6 @@ var ts;
write("});");
}
function emitAMDDependencies(node, includeNonAmdDependencies) {
// An AMD define function has the following shape:
// define(id?, dependencies?, factory);
//
// This has the shape of
// define(name, ["module1", "module2"], function (module1Alias) {
// The location of the alias in the parameter list in the factory function needs to
// match the position of the module name in the dependency list.
//
// To ensure this is true in cases of modules with no aliases, e.g.:
// `import "module"` or `<amd-dependency path= "a.css" />`
// we need to add modules without alias names to the end of the dependencies list
var aliasedModuleNames = [];
var unaliasedModuleNames = [];
var importAliasNames = [];
@@ -29441,9 +29323,6 @@ var ts;
"diams": 0x2666
};
})(ts || (ts = {}));
/// <reference path="sys.ts" />
/// <reference path="emitter.ts" />
/// <reference path="core.ts" />
var ts;
(function (ts) {
ts.programTime = 0;
@@ -30288,10 +30167,6 @@ var ts;
}
ts.createProgram = createProgram;
})(ts || (ts = {}));
/// <reference path="sys.ts"/>
/// <reference path="types.ts"/>
/// <reference path="core.ts"/>
/// <reference path="scanner.ts"/>
var ts;
(function (ts) {
ts.optionDeclarations = [
@@ -30750,8 +30625,6 @@ var ts;
}
ts.parseConfigFile = parseConfigFile;
})(ts || (ts = {}));
/// <reference path="program.ts"/>
/// <reference path="commandLineParser.ts"/>
var ts;
(function (ts) {
function validateLocaleAndSetLanguage(locale, errors) {
+11 -4
View File
@@ -15971,8 +15971,8 @@ var ts;
}
}
function getContextuallyTypedParameterType(parameter) {
if (isFunctionExpressionOrArrowFunction(parameter.parent)) {
var func = parameter.parent;
var func = parameter.parent;
if (isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) {
if (isContextSensitive(func)) {
var contextualSignature = getContextualSignature(func);
if (contextualSignature) {
@@ -25139,8 +25139,15 @@ var ts;
}
else if (declaration.kind === 224) {
write(getGeneratedNameForNode(declaration.parent.parent.parent));
write(".");
writeTextOfNode(currentSourceFile, declaration.propertyName || declaration.name);
var name = declaration.propertyName || declaration.name;
var identifier = ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, name);
if (languageVersion === 0 && identifier === "default") {
write("[\"default\"]");
}
else {
write(".");
write(identifier);
}
return;
}
}
+17 -9
View File
@@ -4954,6 +4954,7 @@ var ts;
}
})(ts || (ts = {}));
/// <reference path="binder.ts" />
/// <reference path="sys.ts" />
/* @internal */
var ts;
(function (ts) {
@@ -5083,16 +5084,16 @@ var ts;
return node.pos;
}
ts.getStartPosOfNode = getStartPosOfNode;
// Returns true if this node is missing from the actual source code. 'missing' is different
// from 'undefined/defined'. When a node is undefined (which can happen for optional nodes
// in the tree), it is definitel missing. HOwever, a node may be defined, but still be
// Returns true if this node is missing from the actual source code. A 'missing' node is different
// from 'undefined/defined'. When a node is undefined (which can happen for optional nodes
// in the tree), it is definitely missing. However, a node may be defined, but still be
// missing. This happens whenever the parser knows it needs to parse something, but can't
// get anything in the source code that it expects at that location. For example:
// get anything in the source code that it expects at that location. For example:
//
// let a: ;
//
// Here, the Type in the Type-Annotation is not-optional (as there is a colon in the source
// code). So the parser will attempt to parse out a type, and will create an actual node.
// code). So the parser will attempt to parse out a type, and will create an actual node.
// However, this node will be 'missing' in the sense that no actual source-code/tokens are
// contained within it.
function nodeIsMissing(node) {
@@ -18922,8 +18923,8 @@ var ts;
}
// Return contextual type of parameter or undefined if no contextual type is available
function getContextuallyTypedParameterType(parameter) {
if (isFunctionExpressionOrArrowFunction(parameter.parent)) {
var func = parameter.parent;
var func = parameter.parent;
if (isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) {
if (isContextSensitive(func)) {
var contextualSignature = getContextualSignature(func);
if (contextualSignature) {
@@ -29868,8 +29869,15 @@ var ts;
else if (declaration.kind === 224 /* ImportSpecifier */) {
// Identifier references named import
write(getGeneratedNameForNode(declaration.parent.parent.parent));
write(".");
writeTextOfNode(currentSourceFile, declaration.propertyName || declaration.name);
var name = declaration.propertyName || declaration.name;
var identifier = ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, name);
if (languageVersion === 0 /* ES3 */ && identifier === "default") {
write("[\"default\"]");
}
else {
write(".");
write(identifier);
}
return;
}
}
+17 -9
View File
@@ -4954,6 +4954,7 @@ var ts;
}
})(ts || (ts = {}));
/// <reference path="binder.ts" />
/// <reference path="sys.ts" />
/* @internal */
var ts;
(function (ts) {
@@ -5083,16 +5084,16 @@ var ts;
return node.pos;
}
ts.getStartPosOfNode = getStartPosOfNode;
// Returns true if this node is missing from the actual source code. 'missing' is different
// from 'undefined/defined'. When a node is undefined (which can happen for optional nodes
// in the tree), it is definitel missing. HOwever, a node may be defined, but still be
// Returns true if this node is missing from the actual source code. A 'missing' node is different
// from 'undefined/defined'. When a node is undefined (which can happen for optional nodes
// in the tree), it is definitely missing. However, a node may be defined, but still be
// missing. This happens whenever the parser knows it needs to parse something, but can't
// get anything in the source code that it expects at that location. For example:
// get anything in the source code that it expects at that location. For example:
//
// let a: ;
//
// Here, the Type in the Type-Annotation is not-optional (as there is a colon in the source
// code). So the parser will attempt to parse out a type, and will create an actual node.
// code). So the parser will attempt to parse out a type, and will create an actual node.
// However, this node will be 'missing' in the sense that no actual source-code/tokens are
// contained within it.
function nodeIsMissing(node) {
@@ -18922,8 +18923,8 @@ var ts;
}
// Return contextual type of parameter or undefined if no contextual type is available
function getContextuallyTypedParameterType(parameter) {
if (isFunctionExpressionOrArrowFunction(parameter.parent)) {
var func = parameter.parent;
var func = parameter.parent;
if (isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) {
if (isContextSensitive(func)) {
var contextualSignature = getContextualSignature(func);
if (contextualSignature) {
@@ -29868,8 +29869,15 @@ var ts;
else if (declaration.kind === 224 /* ImportSpecifier */) {
// Identifier references named import
write(getGeneratedNameForNode(declaration.parent.parent.parent));
write(".");
writeTextOfNode(currentSourceFile, declaration.propertyName || declaration.name);
var name = declaration.propertyName || declaration.name;
var identifier = ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, name);
if (languageVersion === 0 /* ES3 */ && identifier === "default") {
write("[\"default\"]");
}
else {
write(".");
write(identifier);
}
return;
}
}
+2 -1
View File
@@ -35,7 +35,8 @@
"browserify": "latest",
"istanbul": "latest",
"mocha-fivemat-progress-reporter": "latest",
"tslint": "latest"
"tslint": "latest",
"tsd": "latest"
},
"scripts": {
"pretest": "jake tests",
-125
View File
@@ -1,125 +0,0 @@
declare var require: any, process: any;
declare var __dirname: any;
var fs = require("fs");
var path = require("path");
var child_process = require('child_process');
var tscRoot = path.join(__dirname, "..\\");
var tscPath = path.join(tscRoot, "built", "instrumented", "tsc.js");
var rwcTestPath = path.join(tscRoot, "tests", "cases", "rwc", "dt");
var definitelyTypedRoot = process.argv[2];
function fileExtensionIs(path: string, extension: string): boolean {
var pathLen = path.length;
var extLen = extension.length;
return pathLen > extLen && path.substr(pathLen - extLen, extLen).toLocaleLowerCase() === extension.toLocaleLowerCase();
}
function copyFileSync(source, destination) {
var text = fs.readFileSync(source);
fs.writeFileSync(destination, text);
}
function importDefinitelyTypedTest(testCaseName: string, testFiles: string[], responseFile: string ) {
var cmd = "node " + tscPath + " --module commonjs " + testFiles.join(" ");
if (responseFile) cmd += " @" + responseFile;
var testDirectoryName = testCaseName + "_" + Math.floor((Math.random() * 10000) + 1);
var testDirectoryPath = path.join(process.env["temp"], testDirectoryName);
if (fs.existsSync(testDirectoryPath)) {
throw new Error("Could not create test directory");
}
fs.mkdirSync(testDirectoryPath);
child_process.exec(cmd, {
maxBuffer: 1 * 1024 * 1024,
cwd: testDirectoryPath
}, (error, stdout, stderr) => {
console.log("importing " + testCaseName + " ...");
console.log(cmd);
if (error) {
console.log("importing " + testCaseName + " ...");
console.log(cmd);
console.log("==> error " + JSON.stringify(error));
console.log("==> stdout " + String(stdout));
console.log("==> stderr " + String(stderr));
console.log("\r\n");
return;
}
// copy generated file to output location
var outputFilePath = path.join(testDirectoryPath, "iocapture0.json");
var testCasePath = path.join(rwcTestPath, "DefinitelyTyped_" + testCaseName + ".json");
copyFileSync(outputFilePath, testCasePath);
//console.log("output generated at: " + outputFilePath);
if (!fs.existsSync(testCasePath)) {
throw new Error("could not find test case at: " + testCasePath);
}
else {
fs.unlinkSync(outputFilePath);
fs.rmdirSync(testDirectoryPath);
//console.log("testcase generated at: " + testCasePath);
//console.log("Done.");
}
//console.log("\r\n");
})
.on('error', function (error) {
console.log("==> error " + JSON.stringify(error));
console.log("\r\n");
});
}
function importDefinitelyTypedTests(definitelyTypedRoot: string): void {
fs.readdir(definitelyTypedRoot, (err, subDirectorys) => {
if (err) throw err;
subDirectorys
.filter(d => ["_infrastructure", "node_modules", ".git"].indexOf(d) < 0)
.filter(i => i.indexOf("sipml") >=0 )
.filter(i => fs.statSync(path.join(definitelyTypedRoot, i)).isDirectory())
.forEach(d => {
var directoryPath = path.join(definitelyTypedRoot, d);
fs.readdir(directoryPath, function (err, files) {
if (err) throw err;
var tsFiles = [];
var testFiles = [];
var paramFile;
files
.map(f => path.join(directoryPath, f))
.forEach(f => {
if (fileExtensionIs(f, ".ts")) tsFiles.push(f);
else if (fileExtensionIs(f, ".tscparams")) paramFile = f;
if (fileExtensionIs(f, "-tests.ts")) testFiles.push(f);
});
if (testFiles.length === 0) {
// no test files but multiple d.ts's, e.g. winjs
var regexp = new RegExp(d + "(([-][0-9])|([\.]d[\.]ts))");
if (tsFiles.length > 1 && tsFiles.every(t => fileExtensionIs(t, ".d.ts") && regexp.test(t))) {
tsFiles.forEach(filename => {
importDefinitelyTypedTest(path.basename(filename, ".d.ts"), [filename], paramFile);
});
}
else {
importDefinitelyTypedTest(d, tsFiles, paramFile);
}
}
else {
testFiles.forEach(filename => {
importDefinitelyTypedTest(path.basename(filename, "-tests.ts"), [filename], paramFile);
});
}
});
})
});
}
importDefinitelyTypedTests(definitelyTypedRoot);
@@ -0,0 +1,161 @@
import * as fs from "fs";
import * as path from "path";
import * as child_process from "child_process";
interface Map<T> {
[key: string]: T;
}
declare var process: {
argv: string[];
env: Map<string>;
exit(exitCode?: number): void;
}
main();
function main() {
const [, progName, tscRoot, definitelyTypedRoot] = process.argv;
if (process.argv.length !== 4) {
if (process.argv.length < 2) {
throw "Expected at least 2 argv elements."
}
console.log("Usage:")
console.log(` node ${path.relative(__dirname, progName)} [TypeScript Repo Root] [DefinitelyTyped Repo Root]`);
return;
}
const tscPath = path.resolve(tscRoot, "built", "local", "tsc.js");
const rwcTestPath = path.resolve(tscRoot, "internal", "cases", "rwc");
const resolvedDefinitelyTypedRoot = path.resolve(definitelyTypedRoot);
console.log(`Resolved TypeScript Compiler Path: '${tscPath}'.`);
console.log(`Resolved TypeScript RWC Path: '${rwcTestPath}'.`);
console.log(`Resolved DefinitelyTyped Repo Root: '${resolvedDefinitelyTypedRoot}'.`);
importDefinitelyTypedTests(tscPath, rwcTestPath, resolvedDefinitelyTypedRoot);
}
function filePathEndsWith(path: string, endingString: string): boolean {
const pathLen = path.length;
const extLen = endingString.length;
return pathLen > extLen && path.substr(pathLen - extLen, extLen).toLocaleLowerCase() === endingString.toLocaleLowerCase();
}
function copyFileSync(source: string, destination: string) {
let text = fs.readFileSync(source);
fs.writeFileSync(destination, text);
}
function importDefinitelyTypedTest(tscPath: string, rwcTestPath: string, testCaseName: string, testFiles: string[], responseFile: string ) {
let cmd = "node " + tscPath + " --module commonjs " + testFiles.join(" ");
if (responseFile) {
cmd += " @" + responseFile;
}
let testDirectoryName = testCaseName + "_" + Math.floor((Math.random() * 10000) + 1);
let testDirectoryPath = path.join(process.env["temp"], testDirectoryName);
if (fs.existsSync(testDirectoryPath)) {
throw new Error("Could not create test directory");
}
fs.mkdirSync(testDirectoryPath);
child_process.exec(cmd, {
maxBuffer: 1 * 1024 * 1024,
cwd: testDirectoryPath
}, (error, stdout, stderr) => {
console.log("importing " + testCaseName + " ...");
console.log(cmd);
if (error) {
console.log("importing " + testCaseName + " ...");
console.log(cmd);
console.log("==> error " + JSON.stringify(error));
console.log("==> stdout " + String(stdout));
console.log("==> stderr " + String(stderr));
console.log("\r\n");
return;
}
// copy generated file to output location
let outputFilePath = path.join(testDirectoryPath, "iocapture0.json");
let testCasePath = path.join(rwcTestPath, "DefinitelyTyped_" + testCaseName + ".json");
copyFileSync(outputFilePath, testCasePath);
//console.log("output generated at: " + outputFilePath);
if (!fs.existsSync(testCasePath)) {
throw new Error("could not find test case at: " + testCasePath);
}
else {
fs.unlinkSync(outputFilePath);
fs.rmdirSync(testDirectoryPath);
//console.log("testcase generated at: " + testCasePath);
//console.log("Done.");
}
//console.log("\r\n");
})
.on('error', (error: any) => {
console.log("==> error " + JSON.stringify(error));
console.log("\r\n");
});
}
function importDefinitelyTypedTests(tscPath: string, rwcTestPath: string, definitelyTypedRoot: string): void {
fs.readdir(definitelyTypedRoot, (err, subDirectories) => {
if (err) {
throw err;
}
// When you just want to test the script out on one or two files,
// just add a line like the following:
//
// .filter(d => d.indexOf("sipml") >= 0 )
subDirectories
.filter(d => ["_infrastructure", "node_modules", ".git"].indexOf(d) < 0)
.filter(i => fs.statSync(path.join(definitelyTypedRoot, i)).isDirectory())
.forEach(d => {
const directoryPath = path.join(definitelyTypedRoot, d);
fs.readdir(directoryPath, function (err, files) {
if (err) {
throw err;
}
let tsFiles: string[] = [];
let testFiles: string[] = [];
let paramFile: string;
for (const filePath of files.map(f => path.join(directoryPath, f))) {
if (filePathEndsWith(filePath, ".ts")) {
tsFiles.push(filePath);
if (filePathEndsWith(filePath, "-tests.ts")) {
testFiles.push(filePath);
}
}
else if (filePathEndsWith(filePath, ".tscparams")) {
paramFile = filePath;
}
}
if (testFiles.length === 0) {
// no test files but multiple d.ts's, e.g. winjs
const regexp = new RegExp(d + "(([-][0-9])|([\.]d[\.]ts))");
if (tsFiles.length > 1 && tsFiles.every(t => filePathEndsWith(t, ".d.ts") && regexp.test(t))) {
for (const fileName of tsFiles) {
importDefinitelyTypedTest(tscPath, rwcTestPath, path.basename(fileName, ".d.ts"), [fileName], paramFile);
}
}
else {
importDefinitelyTypedTest(tscPath, rwcTestPath, d, tsFiles, paramFile);
}
}
else {
for (const fileName of tsFiles) {
importDefinitelyTypedTest(tscPath, rwcTestPath, path.basename(fileName, "-tests.ts"), [fileName], paramFile);
}
}
});
})
});
}
@@ -0,0 +1,16 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "ES5",
"noImplicitAny": true,
"outDir": "./",
"rootDir": ".",
"sourceMap": false
},
"files": [
"../typings/node/node.d.ts",
"importDefinitelyTypedTests.ts"
],
"exclude": [
]
}
+36 -12
View File
@@ -10,10 +10,6 @@ interface InputDiagnosticMessageTable {
[msg: string]: DiagnosticDetails;
}
interface IIndexable<V> {
[key: string]: V;
}
function main(): void {
var sys = ts.sys;
if (sys.args.length < 1) {
@@ -25,21 +21,49 @@ function main(): void {
var inputFilePath = sys.args[0].replace(/\\/g, "/");
var inputStr = sys.readFile(inputFilePath);
var diagnosticMesages: InputDiagnosticMessageTable = JSON.parse(inputStr);
var diagnosticMessages: InputDiagnosticMessageTable = JSON.parse(inputStr);
var names = Utilities.getObjectKeys(diagnosticMesages);
var names = Utilities.getObjectKeys(diagnosticMessages);
var nameMap = buildUniqueNameMap(names);
var infoFileOutput = buildInfoFileOutput(diagnosticMesages, nameMap);
var infoFileOutput = buildInfoFileOutput(diagnosticMessages, nameMap);
checkForUniqueCodes(names, diagnosticMessages);
// TODO: Fix path joining
var inputDirectory = inputFilePath.substr(0,inputFilePath.lastIndexOf("/"));
var fileOutputPath = inputDirectory + "/diagnosticInformationMap.generated.ts";
sys.writeFile(fileOutputPath, infoFileOutput);
}
function buildUniqueNameMap(names: string[]): IIndexable<string> {
var nameMap: IIndexable<string> = {};
function checkForUniqueCodes(messages: string[], diagnosticTable: InputDiagnosticMessageTable) {
const originalMessageForCode: string[] = [];
let numConflicts = 0;
for (const currentMessage of messages) {
const code = diagnosticTable[currentMessage].code;
if (code in originalMessageForCode) {
const originalMessage = originalMessageForCode[code];
ts.sys.write("\x1b[91m"); // High intensity red.
ts.sys.write("Error");
ts.sys.write("\x1b[0m"); // Reset formatting.
ts.sys.write(`: Diagnostic code '${code}' conflicts between "${originalMessage}" and "${currentMessage}".`);
ts.sys.write(ts.sys.newLine + ts.sys.newLine);
numConflicts++;
}
else {
originalMessageForCode[code] = currentMessage;
}
}
if (numConflicts > 0) {
throw new Error(`Found ${numConflicts} conflict(s) in diagnostic codes.`);
}
}
function buildUniqueNameMap(names: string[]): ts.Map<string> {
var nameMap: ts.Map<string> = {};
var uniqueNames = NameGenerator.ensureUniqueness(names, /* isCaseSensitive */ false, /* isFixed */ undefined);
@@ -50,7 +74,7 @@ function buildUniqueNameMap(names: string[]): IIndexable<string> {
return nameMap;
}
function buildInfoFileOutput(messageTable: InputDiagnosticMessageTable, nameMap: IIndexable<string>): string {
function buildInfoFileOutput(messageTable: InputDiagnosticMessageTable, nameMap: ts.Map<string>): string {
var result =
'// <auto-generated />\r\n' +
'/// <reference path="types.ts" />\r\n' +
@@ -172,7 +196,7 @@ module Utilities {
}
// Like Object.keys
export function getObjectKeys(obj: any): string[]{
export function getObjectKeys(obj: any): string[] {
var result: string[] = [];
for (var name in obj) {
+12
View File
@@ -0,0 +1,12 @@
{
"version": "v4",
"repo": "borisyankov/DefinitelyTyped",
"ref": "master",
"path": "typings",
"bundle": "typings/tsd.d.ts",
"installed": {
"node/node.d.ts": {
"commit": "5f480287834a2615274eea31574b713e64decf17"
}
}
}
+6 -6
View File
@@ -6574,8 +6574,8 @@ namespace ts {
// Return contextual type of parameter or undefined if no contextual type is available
function getContextuallyTypedParameterType(parameter: ParameterDeclaration): Type {
if (isFunctionExpressionOrArrowFunction(parameter.parent)) {
let func = <FunctionExpression>parameter.parent;
let func = parameter.parent;
if (isFunctionExpressionOrArrowFunction(func) || isObjectLiteralMethod(func)) {
if (isContextSensitive(func)) {
let contextualSignature = getContextualSignature(func);
if (contextualSignature) {
@@ -6907,7 +6907,7 @@ namespace ts {
}
}
function isFunctionExpressionOrArrowFunction(node: Node): boolean {
function isFunctionExpressionOrArrowFunction(node: Node): node is FunctionExpression {
return node.kind === SyntaxKind.FunctionExpression || node.kind === SyntaxKind.ArrowFunction;
}
@@ -6926,8 +6926,8 @@ namespace ts {
function getContextualSignature(node: FunctionExpression | MethodDeclaration): Signature {
Debug.assert(node.kind !== SyntaxKind.MethodDeclaration || isObjectLiteralMethod(node));
let type = isObjectLiteralMethod(node)
? getContextualTypeForObjectLiteralMethod(<MethodDeclaration>node)
: getContextualType(<FunctionExpression>node);
? getContextualTypeForObjectLiteralMethod(node)
: getContextualType(node);
if (!type) {
return undefined;
}
@@ -13656,7 +13656,7 @@ namespace ts {
forEach(node.decorators, checkFunctionAndClassExpressionBodies);
forEach((<MethodDeclaration>node).parameters, checkFunctionAndClassExpressionBodies);
if (isObjectLiteralMethod(node)) {
checkFunctionExpressionOrObjectLiteralMethodBody(<MethodDeclaration>node);
checkFunctionExpressionOrObjectLiteralMethodBody(node);
}
break;
case SyntaxKind.Constructor:
@@ -140,7 +140,7 @@ namespace ts {
Property_destructuring_pattern_expected: { code: 1180, category: DiagnosticCategory.Error, key: "Property destructuring pattern expected." },
Array_element_destructuring_pattern_expected: { code: 1181, category: DiagnosticCategory.Error, key: "Array element destructuring pattern expected." },
A_destructuring_declaration_must_have_an_initializer: { code: 1182, category: DiagnosticCategory.Error, key: "A destructuring declaration must have an initializer." },
An_implementation_cannot_be_declared_in_ambient_contexts: { code: 1184, category: DiagnosticCategory.Error, key: "An implementation cannot be declared in ambient contexts." },
An_implementation_cannot_be_declared_in_ambient_contexts: { code: 1183, category: DiagnosticCategory.Error, key: "An implementation cannot be declared in ambient contexts." },
Modifiers_cannot_appear_here: { code: 1184, category: DiagnosticCategory.Error, key: "Modifiers cannot appear here." },
Merge_conflict_marker_encountered: { code: 1185, category: DiagnosticCategory.Error, key: "Merge conflict marker encountered." },
A_rest_element_cannot_have_an_initializer: { code: 1186, category: DiagnosticCategory.Error, key: "A rest element cannot have an initializer." },
@@ -190,10 +190,6 @@ namespace ts {
An_export_declaration_can_only_be_used_in_a_module: { code: 1233, category: DiagnosticCategory.Error, key: "An export declaration can only be used in a module." },
An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file: { code: 1234, category: DiagnosticCategory.Error, key: "An ambient module declaration is only allowed at the top level in a file." },
A_namespace_declaration_is_only_allowed_in_a_namespace_or_module: { code: 1235, category: DiagnosticCategory.Error, key: "A namespace declaration is only allowed in a namespace or module." },
Experimental_support_for_async_functions_is_a_feature_that_is_subject_to_change_in_a_future_release_Specify_experimentalAsyncFunctions_to_remove_this_warning: { code: 1236, category: DiagnosticCategory.Error, key: "Experimental support for async functions is a feature that is subject to change in a future release. Specify '--experimentalAsyncFunctions' to remove this warning." },
with_statements_are_not_allowed_in_an_async_function_block: { code: 1300, category: DiagnosticCategory.Error, key: "'with' statements are not allowed in an async function block." },
await_expression_is_only_allowed_within_an_async_function: { code: 1308, category: DiagnosticCategory.Error, key: "'await' expression is only allowed within an async function." },
Async_functions_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1311, category: DiagnosticCategory.Error, key: "Async functions are only available when targeting ECMAScript 6 and higher." },
The_return_type_of_a_property_decorator_function_must_be_either_void_or_any: { code: 1236, category: DiagnosticCategory.Error, key: "The return type of a property decorator function must be either 'void' or 'any'." },
The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any: { code: 1237, category: DiagnosticCategory.Error, key: "The return type of a parameter decorator function must be either 'void' or 'any'." },
Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression: { code: 1238, category: DiagnosticCategory.Error, key: "Unable to resolve signature of class decorator when called as an expression." },
@@ -204,6 +200,10 @@ namespace ts {
_0_modifier_cannot_be_used_with_1_modifier: { code: 1243, category: DiagnosticCategory.Error, key: "'{0}' modifier cannot be used with '{1}' modifier." },
Abstract_methods_can_only_appear_within_an_abstract_class: { code: 1244, category: DiagnosticCategory.Error, key: "Abstract methods can only appear within an abstract class." },
Method_0_cannot_have_an_implementation_because_it_is_marked_abstract: { code: 1245, category: DiagnosticCategory.Error, key: "Method '{0}' cannot have an implementation because it is marked abstract." },
Experimental_support_for_async_functions_is_a_feature_that_is_subject_to_change_in_a_future_release_Specify_experimentalAsyncFunctions_to_remove_this_warning: { code: 1246, category: DiagnosticCategory.Error, key: "Experimental support for async functions is a feature that is subject to change in a future release. Specify '--experimentalAsyncFunctions' to remove this warning." },
with_statements_are_not_allowed_in_an_async_function_block: { code: 1300, category: DiagnosticCategory.Error, key: "'with' statements are not allowed in an async function block." },
await_expression_is_only_allowed_within_an_async_function: { code: 1308, category: DiagnosticCategory.Error, key: "'await' expression is only allowed within an async function." },
Async_functions_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1311, category: DiagnosticCategory.Error, key: "Async functions are only available when targeting ECMAScript 6 and higher." },
Duplicate_identifier_0: { code: 2300, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." },
Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." },
Static_members_cannot_reference_class_type_parameters: { code: 2302, category: DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." },
@@ -516,8 +516,8 @@ namespace ts {
Option_inlineSources_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided: { code: 5051, category: DiagnosticCategory.Error, key: "Option 'inlineSources' can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided." },
Option_0_cannot_be_specified_without_specifying_option_1: { code: 5052, category: DiagnosticCategory.Error, key: "Option '{0}' cannot be specified without specifying option '{1}'." },
Option_0_cannot_be_specified_with_option_1: { code: 5053, category: DiagnosticCategory.Error, key: "Option '{0}' cannot be specified with option '{1}'." },
A_tsconfig_json_file_is_already_defined_at_Colon_0: { code: 5053, category: DiagnosticCategory.Error, key: "A 'tsconfig.json' file is already defined at: '{0}'." },
Could_not_write_file_0_which_is_one_of_the_input_files: { code: 5054, category: DiagnosticCategory.Error, key: "Could not write file '{0}' which is one of the input files." },
A_tsconfig_json_file_is_already_defined_at_Colon_0: { code: 5054, category: DiagnosticCategory.Error, key: "A 'tsconfig.json' file is already defined at: '{0}'." },
Could_not_write_file_0_which_is_one_of_the_input_files: { code: 5055, category: DiagnosticCategory.Error, key: "Could not write file '{0}' which is one of the input files." },
Concatenate_and_emit_output_to_single_file: { code: 6001, category: DiagnosticCategory.Message, key: "Concatenate and emit output to single file." },
Generates_corresponding_d_ts_file: { code: 6002, category: DiagnosticCategory.Message, key: "Generates corresponding '.d.ts' file." },
Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: { code: 6003, category: DiagnosticCategory.Message, key: "Specifies the location where debugger should locate map files instead of generated locations." },
+24 -25
View File
@@ -549,7 +549,7 @@
},
"An implementation cannot be declared in ambient contexts.": {
"category": "Error",
"code": 1184
"code": 1183
},
"Modifiers cannot appear here.": {
"category": "Error",
@@ -747,24 +747,6 @@
"category": "Error",
"code": 1235
},
"Experimental support for async functions is a feature that is subject to change in a future release. Specify '--experimentalAsyncFunctions' to remove this warning.": {
"category": "Error",
"code": 1236
},
"'with' statements are not allowed in an async function block.": {
"category": "Error",
"code": 1300
},
"'await' expression is only allowed within an async function.": {
"category": "Error",
"code": 1308
},
"Async functions are only available when targeting ECMAScript 6 and higher.": {
"category": "Error",
"code": 1311
},
"The return type of a property decorator function must be either 'void' or 'any'.": {
"category": "Error",
"code": 1236
@@ -805,6 +787,23 @@
"category": "Error",
"code": 1245
},
"Experimental support for async functions is a feature that is subject to change in a future release. Specify '--experimentalAsyncFunctions' to remove this warning.": {
"category": "Error",
"code": 1246
},
"'with' statements are not allowed in an async function block.": {
"category": "Error",
"code": 1300
},
"'await' expression is only allowed within an async function.": {
"category": "Error",
"code": 1308
},
"Async functions are only available when targeting ECMAScript 6 and higher.": {
"category": "Error",
"code": 1311
},
"Duplicate identifier '{0}'.": {
"category": "Error",
"code": 2300
@@ -1700,11 +1699,11 @@
"Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead.": {
"category": "Error",
"code": 2652
},
},
"Non-abstract class expression does not implement inherited abstract member '{0}' from class '{1}'.": {
"category": "Error",
"code": 2653
},
},
"Exported external package typings file cannot contain tripleslash references. Please contact the package author to update the package definition.": {
"category": "Error",
"code": 2654
@@ -1712,11 +1711,11 @@
"Exported external package typings can only be in '.d.ts' files. Please contact the package author to update the package definition.": {
"category": "Error",
"code": 2655
},
},
"Exported external package typings file '{0}' is not a module. Please contact the package author to update the package definition.": {
"category": "Error",
"code": 2656
},
},
"Import declaration '{0}' is using private name '{1}'.": {
"category": "Error",
"code": 4000
@@ -2055,11 +2054,11 @@
},
"A 'tsconfig.json' file is already defined at: '{0}'.": {
"category": "Error",
"code": 5053
"code": 5054
},
"Could not write file '{0}' which is one of the input files.": {
"category": "Error",
"code": 5054
"code": 5055
},
"Concatenate and emit output to single file.": {
+7 -6
View File
@@ -1,4 +1,5 @@
/// <reference path="binder.ts" />
/// <reference path="sys.ts" />
/* @internal */
namespace ts {
@@ -164,16 +165,16 @@ namespace ts {
return node.pos;
}
// Returns true if this node is missing from the actual source code. 'missing' is different
// from 'undefined/defined'. When a node is undefined (which can happen for optional nodes
// in the tree), it is definitel missing. HOwever, a node may be defined, but still be
// Returns true if this node is missing from the actual source code. A 'missing' node is different
// from 'undefined/defined'. When a node is undefined (which can happen for optional nodes
// in the tree), it is definitely missing. However, a node may be defined, but still be
// missing. This happens whenever the parser knows it needs to parse something, but can't
// get anything in the source code that it expects at that location. For example:
// get anything in the source code that it expects at that location. For example:
//
// let a: ;
//
// Here, the Type in the Type-Annotation is not-optional (as there is a colon in the source
// code). So the parser will attempt to parse out a type, and will create an actual node.
// code). So the parser will attempt to parse out a type, and will create an actual node.
// However, this node will be 'missing' in the sense that no actual source-code/tokens are
// contained within it.
export function nodeIsMissing(node: Node) {
@@ -660,7 +661,7 @@ namespace ts {
return node && node.kind === SyntaxKind.Block && isFunctionLike(node.parent);
}
export function isObjectLiteralMethod(node: Node) {
export function isObjectLiteralMethod(node: Node): node is MethodDeclaration {
return node && node.kind === SyntaxKind.MethodDeclaration && node.parent.kind === SyntaxKind.ObjectLiteralExpression;
}
+2 -2
View File
@@ -41,7 +41,7 @@ declare module Intl {
currency?: string;
currencyDisplay?: string;
useGrouping?: boolean;
minimumintegerDigits?: number;
minimumIntegerDigits?: number;
minimumFractionDigits?: number;
maximumFractionDigits?: number;
minimumSignificantDigits?: number;
@@ -54,7 +54,7 @@ declare module Intl {
style: string;
currency?: string;
currencyDisplay?: string;
minimumintegerDigits: number;
minimumIntegerDigits: number;
minimumFractionDigits: number;
maximumFractionDigits: number;
minimumSignificantDigits?: number;
@@ -1,16 +1,16 @@
tests/cases/conformance/ambient/ambientErrors.ts(2,15): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/conformance/ambient/ambientErrors.ts(6,18): error TS2382: Specialized overload signature is not assignable to any non-specialized signature.
tests/cases/conformance/ambient/ambientErrors.ts(17,22): error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
tests/cases/conformance/ambient/ambientErrors.ts(20,24): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/ambient/ambientErrors.ts(20,24): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/ambient/ambientErrors.ts(24,5): error TS1066: Ambient enum elements can only have integer literal initializers.
tests/cases/conformance/ambient/ambientErrors.ts(29,5): error TS1066: Ambient enum elements can only have integer literal initializers.
tests/cases/conformance/ambient/ambientErrors.ts(34,11): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/conformance/ambient/ambientErrors.ts(35,19): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/ambient/ambientErrors.ts(35,19): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/ambient/ambientErrors.ts(37,20): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/conformance/ambient/ambientErrors.ts(38,13): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/conformance/ambient/ambientErrors.ts(39,23): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/ambient/ambientErrors.ts(40,14): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/ambient/ambientErrors.ts(41,22): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/ambient/ambientErrors.ts(39,23): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/ambient/ambientErrors.ts(40,14): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/ambient/ambientErrors.ts(41,22): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/ambient/ambientErrors.ts(47,20): error TS2435: Ambient modules cannot be nested in other modules.
tests/cases/conformance/ambient/ambientErrors.ts(51,16): error TS2436: Ambient module declaration cannot specify relative module name.
tests/cases/conformance/ambient/ambientErrors.ts(57,5): error TS2309: An export assignment cannot be used in a module with other exported elements.
@@ -44,7 +44,7 @@ tests/cases/conformance/ambient/ambientErrors.ts(57,5): error TS2309: An export
// Ambient function with function body
declare function fn4() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
// Ambient enum with non - integer literal constant member
declare enum E1 {
@@ -67,7 +67,7 @@ tests/cases/conformance/ambient/ambientErrors.ts(57,5): error TS2309: An export
!!! error TS1039: Initializers are not allowed in ambient contexts.
function fn() { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
class C {
static x = 3;
~
@@ -77,13 +77,13 @@ tests/cases/conformance/ambient/ambientErrors.ts(57,5): error TS2309: An export
!!! error TS1039: Initializers are not allowed in ambient contexts.
constructor() { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
fn() { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
static sfn() { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
}
}
@@ -1,5 +1,5 @@
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractDeclarations.d.ts(2,5): error TS1242: 'abstract' modifier can only appear on a class or method declaration.
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractDeclarations.d.ts(2,28): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractDeclarations.d.ts(2,28): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractDeclarations.d.ts(11,15): error TS2515: Non-abstract class 'CC' does not implement inherited abstract member 'foo' from class 'AA'.
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractDeclarations.d.ts(13,15): error TS2515: Non-abstract class 'DD' does not implement inherited abstract member 'foo' from class 'BB'.
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractDeclarations.d.ts(17,15): error TS2515: Non-abstract class 'FF' does not implement inherited abstract member 'foo' from class 'CC'.
@@ -11,7 +11,7 @@ tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbst
~~~~~~~~
!!! error TS1242: 'abstract' modifier can only appear on a class or method declaration.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
}
declare abstract class AA {
@@ -1,4 +1,4 @@
tests/cases/compiler/constructorOverloads6.ts(4,25): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/constructorOverloads6.ts(4,25): error TS1183: An implementation cannot be declared in ambient contexts.
==== tests/cases/compiler/constructorOverloads6.ts (1 errors) ====
@@ -7,7 +7,7 @@ tests/cases/compiler/constructorOverloads6.ts(4,25): error TS1184: An implementa
constructor(n: number);
constructor(x: any) {
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
}
bar1():void;
@@ -0,0 +1,67 @@
tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedClassExpressionMethodDeclaration01.ts(17,24): error TS7006: Parameter 'arg' implicitly has an 'any' type.
tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedClassExpressionMethodDeclaration01.ts(20,24): error TS7006: Parameter 'arg' implicitly has an 'any' type.
tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedClassExpressionMethodDeclaration01.ts(28,27): error TS7006: Parameter 'arg' implicitly has an 'any' type.
tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedClassExpressionMethodDeclaration01.ts(31,27): error TS7006: Parameter 'arg' implicitly has an 'any' type.
tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedClassExpressionMethodDeclaration01.ts(39,36): error TS7006: Parameter 'arg' implicitly has an 'any' type.
tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedClassExpressionMethodDeclaration01.ts(42,36): error TS7006: Parameter 'arg' implicitly has an 'any' type.
==== tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedClassExpressionMethodDeclaration01.ts (6 errors) ====
interface A {
numProp: number;
}
interface B {
strProp: string;
}
interface Foo {
method1(arg: A): void;
method2(arg: B): void;
}
function getFoo1(): Foo {
return class {
static method1(arg) {
~~~
!!! error TS7006: Parameter 'arg' implicitly has an 'any' type.
arg.numProp = 10;
}
static method2(arg) {
~~~
!!! error TS7006: Parameter 'arg' implicitly has an 'any' type.
arg.strProp = "hello";
}
}
}
function getFoo2(): Foo {
return class {
static method1 = (arg) => {
~~~
!!! error TS7006: Parameter 'arg' implicitly has an 'any' type.
arg.numProp = 10;
}
static method2 = (arg) => {
~~~
!!! error TS7006: Parameter 'arg' implicitly has an 'any' type.
arg.strProp = "hello";
}
}
}
function getFoo3(): Foo {
return class {
static method1 = function (arg) {
~~~
!!! error TS7006: Parameter 'arg' implicitly has an 'any' type.
arg.numProp = 10;
}
static method2 = function (arg) {
~~~
!!! error TS7006: Parameter 'arg' implicitly has an 'any' type.
arg.strProp = "hello";
}
}
}
@@ -0,0 +1,88 @@
//// [contextuallyTypedClassExpressionMethodDeclaration01.ts]
interface A {
numProp: number;
}
interface B {
strProp: string;
}
interface Foo {
method1(arg: A): void;
method2(arg: B): void;
}
function getFoo1(): Foo {
return class {
static method1(arg) {
arg.numProp = 10;
}
static method2(arg) {
arg.strProp = "hello";
}
}
}
function getFoo2(): Foo {
return class {
static method1 = (arg) => {
arg.numProp = 10;
}
static method2 = (arg) => {
arg.strProp = "hello";
}
}
}
function getFoo3(): Foo {
return class {
static method1 = function (arg) {
arg.numProp = 10;
}
static method2 = function (arg) {
arg.strProp = "hello";
}
}
}
//// [contextuallyTypedClassExpressionMethodDeclaration01.js]
function getFoo1() {
return (function () {
function class_1() {
}
class_1.method1 = function (arg) {
arg.numProp = 10;
};
class_1.method2 = function (arg) {
arg.strProp = "hello";
};
return class_1;
})();
}
function getFoo2() {
return (function () {
function class_2() {
}
class_2.method1 = function (arg) {
arg.numProp = 10;
};
class_2.method2 = function (arg) {
arg.strProp = "hello";
};
return class_2;
})();
}
function getFoo3() {
return (function () {
function class_3() {
}
class_3.method1 = function (arg) {
arg.numProp = 10;
};
class_3.method2 = function (arg) {
arg.strProp = "hello";
};
return class_3;
})();
}
@@ -0,0 +1,71 @@
tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedClassExpressionMethodDeclaration02.ts(21,17): error TS7006: Parameter 'arg' implicitly has an 'any' type.
tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedClassExpressionMethodDeclaration02.ts(24,17): error TS7006: Parameter 'arg' implicitly has an 'any' type.
tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedClassExpressionMethodDeclaration02.ts(32,20): error TS7006: Parameter 'arg' implicitly has an 'any' type.
tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedClassExpressionMethodDeclaration02.ts(35,20): error TS7006: Parameter 'arg' implicitly has an 'any' type.
tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedClassExpressionMethodDeclaration02.ts(43,29): error TS7006: Parameter 'arg' implicitly has an 'any' type.
tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedClassExpressionMethodDeclaration02.ts(46,29): error TS7006: Parameter 'arg' implicitly has an 'any' type.
==== tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedClassExpressionMethodDeclaration02.ts (6 errors) ====
interface A {
numProp: number;
}
interface B {
strProp: string;
}
interface Foo {
new (): Bar;
}
interface Bar {
method1(arg: A): void;
method2(arg: B): void;
}
function getFoo1(): Foo {
return class {
method1(arg) {
~~~
!!! error TS7006: Parameter 'arg' implicitly has an 'any' type.
arg.numProp = 10;
}
method2(arg) {
~~~
!!! error TS7006: Parameter 'arg' implicitly has an 'any' type.
arg.strProp = "hello";
}
}
}
function getFoo2(): Foo {
return class {
method1 = (arg) => {
~~~
!!! error TS7006: Parameter 'arg' implicitly has an 'any' type.
arg.numProp = 10;
}
method2 = (arg) => {
~~~
!!! error TS7006: Parameter 'arg' implicitly has an 'any' type.
arg.strProp = "hello";
}
}
}
function getFoo3(): Foo {
return class {
method1 = function (arg) {
~~~
!!! error TS7006: Parameter 'arg' implicitly has an 'any' type.
arg.numProp = 10;
}
method2 = function (arg) {
~~~
!!! error TS7006: Parameter 'arg' implicitly has an 'any' type.
arg.strProp = "hello";
}
}
}
@@ -0,0 +1,92 @@
//// [contextuallyTypedClassExpressionMethodDeclaration02.ts]
interface A {
numProp: number;
}
interface B {
strProp: string;
}
interface Foo {
new (): Bar;
}
interface Bar {
method1(arg: A): void;
method2(arg: B): void;
}
function getFoo1(): Foo {
return class {
method1(arg) {
arg.numProp = 10;
}
method2(arg) {
arg.strProp = "hello";
}
}
}
function getFoo2(): Foo {
return class {
method1 = (arg) => {
arg.numProp = 10;
}
method2 = (arg) => {
arg.strProp = "hello";
}
}
}
function getFoo3(): Foo {
return class {
method1 = function (arg) {
arg.numProp = 10;
}
method2 = function (arg) {
arg.strProp = "hello";
}
}
}
//// [contextuallyTypedClassExpressionMethodDeclaration02.js]
function getFoo1() {
return (function () {
function class_1() {
}
class_1.prototype.method1 = function (arg) {
arg.numProp = 10;
};
class_1.prototype.method2 = function (arg) {
arg.strProp = "hello";
};
return class_1;
})();
}
function getFoo2() {
return (function () {
function class_2() {
this.method1 = function (arg) {
arg.numProp = 10;
};
this.method2 = function (arg) {
arg.strProp = "hello";
};
}
return class_2;
})();
}
function getFoo3() {
return (function () {
function class_3() {
this.method1 = function (arg) {
arg.numProp = 10;
};
this.method2 = function (arg) {
arg.strProp = "hello";
};
}
return class_3;
})();
}
@@ -0,0 +1,79 @@
//// [contextuallyTypedObjectLiteralMethodDeclaration01.ts]
interface A {
numProp: number;
}
interface B {
strProp: string;
}
interface Foo {
method1(arg: A): void;
method2(arg: B): void;
}
function getFoo1(): Foo {
return {
method1(arg) {
arg.numProp = 10;
},
method2(arg) {
arg.strProp = "hello";
}
}
}
function getFoo2(): Foo {
return {
method1: (arg) => {
arg.numProp = 10;
},
method2: (arg) => {
arg.strProp = "hello";
}
}
}
function getFoo3(): Foo {
return {
method1: function (arg) {
arg.numProp = 10;
},
method2: function (arg) {
arg.strProp = "hello";
}
}
}
//// [contextuallyTypedObjectLiteralMethodDeclaration01.js]
function getFoo1() {
return {
method1: function (arg) {
arg.numProp = 10;
},
method2: function (arg) {
arg.strProp = "hello";
}
};
}
function getFoo2() {
return {
method1: function (arg) {
arg.numProp = 10;
},
method2: function (arg) {
arg.strProp = "hello";
}
};
}
function getFoo3() {
return {
method1: function (arg) {
arg.numProp = 10;
},
method2: function (arg) {
arg.strProp = "hello";
}
};
}
@@ -0,0 +1,110 @@
=== tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedObjectLiteralMethodDeclaration01.ts ===
interface A {
>A : Symbol(A, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 0, 0))
numProp: number;
>numProp : Symbol(numProp, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 1, 13))
}
interface B {
>B : Symbol(B, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 3, 1))
strProp: string;
>strProp : Symbol(strProp, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 5, 14))
}
interface Foo {
>Foo : Symbol(Foo, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 7, 1))
method1(arg: A): void;
>method1 : Symbol(method1, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 9, 15))
>arg : Symbol(arg, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 10, 12))
>A : Symbol(A, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 0, 0))
method2(arg: B): void;
>method2 : Symbol(method2, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 10, 26))
>arg : Symbol(arg, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 11, 12))
>B : Symbol(B, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 3, 1))
}
function getFoo1(): Foo {
>getFoo1 : Symbol(getFoo1, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 12, 1))
>Foo : Symbol(Foo, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 7, 1))
return {
method1(arg) {
>method1 : Symbol(method1, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 15, 12))
>arg : Symbol(arg, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 16, 16))
arg.numProp = 10;
>arg.numProp : Symbol(A.numProp, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 1, 13))
>arg : Symbol(arg, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 16, 16))
>numProp : Symbol(A.numProp, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 1, 13))
},
method2(arg) {
>method2 : Symbol(method2, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 18, 10))
>arg : Symbol(arg, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 19, 16))
arg.strProp = "hello";
>arg.strProp : Symbol(B.strProp, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 5, 14))
>arg : Symbol(arg, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 19, 16))
>strProp : Symbol(B.strProp, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 5, 14))
}
}
}
function getFoo2(): Foo {
>getFoo2 : Symbol(getFoo2, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 23, 1))
>Foo : Symbol(Foo, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 7, 1))
return {
method1: (arg) => {
>method1 : Symbol(method1, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 26, 12))
>arg : Symbol(arg, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 27, 18))
arg.numProp = 10;
>arg.numProp : Symbol(A.numProp, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 1, 13))
>arg : Symbol(arg, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 27, 18))
>numProp : Symbol(A.numProp, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 1, 13))
},
method2: (arg) => {
>method2 : Symbol(method2, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 29, 10))
>arg : Symbol(arg, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 30, 18))
arg.strProp = "hello";
>arg.strProp : Symbol(B.strProp, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 5, 14))
>arg : Symbol(arg, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 30, 18))
>strProp : Symbol(B.strProp, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 5, 14))
}
}
}
function getFoo3(): Foo {
>getFoo3 : Symbol(getFoo3, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 34, 1))
>Foo : Symbol(Foo, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 7, 1))
return {
method1: function (arg) {
>method1 : Symbol(method1, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 37, 12))
>arg : Symbol(arg, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 38, 27))
arg.numProp = 10;
>arg.numProp : Symbol(A.numProp, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 1, 13))
>arg : Symbol(arg, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 38, 27))
>numProp : Symbol(A.numProp, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 1, 13))
},
method2: function (arg) {
>method2 : Symbol(method2, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 40, 10))
>arg : Symbol(arg, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 41, 27))
arg.strProp = "hello";
>arg.strProp : Symbol(B.strProp, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 5, 14))
>arg : Symbol(arg, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 41, 27))
>strProp : Symbol(B.strProp, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 5, 14))
}
}
}
@@ -0,0 +1,132 @@
=== tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedObjectLiteralMethodDeclaration01.ts ===
interface A {
>A : A
numProp: number;
>numProp : number
}
interface B {
>B : B
strProp: string;
>strProp : string
}
interface Foo {
>Foo : Foo
method1(arg: A): void;
>method1 : (arg: A) => void
>arg : A
>A : A
method2(arg: B): void;
>method2 : (arg: B) => void
>arg : B
>B : B
}
function getFoo1(): Foo {
>getFoo1 : () => Foo
>Foo : Foo
return {
>{ method1(arg) { arg.numProp = 10; }, method2(arg) { arg.strProp = "hello"; } } : { method1(arg: A): void; method2(arg: B): void; }
method1(arg) {
>method1 : (arg: A) => void
>arg : A
arg.numProp = 10;
>arg.numProp = 10 : number
>arg.numProp : number
>arg : A
>numProp : number
>10 : number
},
method2(arg) {
>method2 : (arg: B) => void
>arg : B
arg.strProp = "hello";
>arg.strProp = "hello" : string
>arg.strProp : string
>arg : B
>strProp : string
>"hello" : string
}
}
}
function getFoo2(): Foo {
>getFoo2 : () => Foo
>Foo : Foo
return {
>{ method1: (arg) => { arg.numProp = 10; }, method2: (arg) => { arg.strProp = "hello"; } } : { method1: (arg: A) => void; method2: (arg: B) => void; }
method1: (arg) => {
>method1 : (arg: A) => void
>(arg) => { arg.numProp = 10; } : (arg: A) => void
>arg : A
arg.numProp = 10;
>arg.numProp = 10 : number
>arg.numProp : number
>arg : A
>numProp : number
>10 : number
},
method2: (arg) => {
>method2 : (arg: B) => void
>(arg) => { arg.strProp = "hello"; } : (arg: B) => void
>arg : B
arg.strProp = "hello";
>arg.strProp = "hello" : string
>arg.strProp : string
>arg : B
>strProp : string
>"hello" : string
}
}
}
function getFoo3(): Foo {
>getFoo3 : () => Foo
>Foo : Foo
return {
>{ method1: function (arg) { arg.numProp = 10; }, method2: function (arg) { arg.strProp = "hello"; } } : { method1: (arg: A) => void; method2: (arg: B) => void; }
method1: function (arg) {
>method1 : (arg: A) => void
>function (arg) { arg.numProp = 10; } : (arg: A) => void
>arg : A
arg.numProp = 10;
>arg.numProp = 10 : number
>arg.numProp : number
>arg : A
>numProp : number
>10 : number
},
method2: function (arg) {
>method2 : (arg: B) => void
>function (arg) { arg.strProp = "hello"; } : (arg: B) => void
>arg : B
arg.strProp = "hello";
>arg.strProp = "hello" : string
>arg.strProp : string
>arg : B
>strProp : string
>"hello" : string
}
}
}
@@ -1,15 +1,15 @@
tests/cases/compiler/exportDeclareClass1.ts(2,21): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/exportDeclareClass1.ts(3,31): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/exportDeclareClass1.ts(2,21): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/exportDeclareClass1.ts(3,31): error TS1183: An implementation cannot be declared in ambient contexts.
==== tests/cases/compiler/exportDeclareClass1.ts (2 errors) ====
export declare class eaC {
static tF() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
static tsF(param:any) { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
};
export declare class eaC2 {
@@ -1,4 +1,4 @@
tests/cases/compiler/externSyntax.ts(8,20): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/externSyntax.ts(8,20): error TS1183: An implementation cannot be declared in ambient contexts.
==== tests/cases/compiler/externSyntax.ts (1 errors) ====
@@ -11,7 +11,7 @@ tests/cases/compiler/externSyntax.ts(8,20): error TS1184: An implementation cann
public f();
public g() { } // error body
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
}
}
@@ -1,11 +1,11 @@
tests/cases/compiler/functionsWithModifiersInBlocks1.ts(2,4): error TS1184: Modifiers cannot appear here.
tests/cases/compiler/functionsWithModifiersInBlocks1.ts(2,21): error TS2393: Duplicate function implementation.
tests/cases/compiler/functionsWithModifiersInBlocks1.ts(2,25): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/functionsWithModifiersInBlocks1.ts(2,25): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/functionsWithModifiersInBlocks1.ts(3,4): error TS1184: Modifiers cannot appear here.
tests/cases/compiler/functionsWithModifiersInBlocks1.ts(3,20): error TS2393: Duplicate function implementation.
tests/cases/compiler/functionsWithModifiersInBlocks1.ts(4,4): error TS1184: Modifiers cannot appear here.
tests/cases/compiler/functionsWithModifiersInBlocks1.ts(4,28): error TS2393: Duplicate function implementation.
tests/cases/compiler/functionsWithModifiersInBlocks1.ts(4,32): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/functionsWithModifiersInBlocks1.ts(4,32): error TS1183: An implementation cannot be declared in ambient contexts.
==== tests/cases/compiler/functionsWithModifiersInBlocks1.ts (8 errors) ====
@@ -16,7 +16,7 @@ tests/cases/compiler/functionsWithModifiersInBlocks1.ts(4,32): error TS1184: An
~
!!! error TS2393: Duplicate function implementation.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
export function f() { }
~~~~~~
!!! error TS1184: Modifiers cannot appear here.
@@ -28,5 +28,5 @@ tests/cases/compiler/functionsWithModifiersInBlocks1.ts(4,32): error TS1184: An
~
!!! error TS2393: Duplicate function implementation.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
}
+108 -108
View File
@@ -44,7 +44,7 @@ tests/cases/compiler/giant.ts(125,10): error TS2304: Cannot find name 'p'.
tests/cases/compiler/giant.ts(126,9): error TS1021: An index signature must have a type annotation.
tests/cases/compiler/giant.ts(127,10): error TS1096: An index signature must have exactly one parameter.
tests/cases/compiler/giant.ts(140,9): error TS2386: Overload signatures must all be optional or required.
tests/cases/compiler/giant.ts(154,39): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(154,39): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(166,16): error TS2300: Duplicate identifier 'pgF'.
tests/cases/compiler/giant.ts(167,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(167,20): error TS2300: Duplicate identifier 'pgF'.
@@ -68,39 +68,39 @@ tests/cases/compiler/giant.ts(204,10): error TS2304: Cannot find name 'p'.
tests/cases/compiler/giant.ts(205,9): error TS1021: An index signature must have a type annotation.
tests/cases/compiler/giant.ts(206,10): error TS1096: An index signature must have exactly one parameter.
tests/cases/compiler/giant.ts(219,9): error TS2386: Overload signatures must all be optional or required.
tests/cases/compiler/giant.ts(233,39): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(238,35): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(240,24): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(243,21): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(244,22): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(233,39): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(238,35): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(240,24): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(243,21): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(244,22): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(245,16): error TS2300: Duplicate identifier 'pgF'.
tests/cases/compiler/giant.ts(245,22): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(245,22): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(246,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(246,20): error TS2300: Duplicate identifier 'pgF'.
tests/cases/compiler/giant.ts(247,16): error TS2300: Duplicate identifier 'psF'.
tests/cases/compiler/giant.ts(247,31): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(247,31): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(248,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(248,20): error TS2300: Duplicate identifier 'psF'.
tests/cases/compiler/giant.ts(249,17): error TS2300: Duplicate identifier 'rgF'.
tests/cases/compiler/giant.ts(249,23): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(249,23): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(250,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(250,21): error TS2300: Duplicate identifier 'rgF'.
tests/cases/compiler/giant.ts(251,17): error TS2300: Duplicate identifier 'rsF'.
tests/cases/compiler/giant.ts(251,32): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(251,32): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(252,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(252,21): error TS2300: Duplicate identifier 'rsF'.
tests/cases/compiler/giant.ts(254,21): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(254,21): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(255,16): error TS2300: Duplicate identifier 'tsF'.
tests/cases/compiler/giant.ts(255,31): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(255,31): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(256,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(256,20): error TS2300: Duplicate identifier 'tsF'.
tests/cases/compiler/giant.ts(257,16): error TS2300: Duplicate identifier 'tgF'.
tests/cases/compiler/giant.ts(257,22): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(257,22): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(258,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(258,20): error TS2300: Duplicate identifier 'tgF'.
tests/cases/compiler/giant.ts(262,22): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(262,22): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(262,25): error TS1036: Statements are not allowed in ambient contexts.
tests/cases/compiler/giant.ts(267,30): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(267,30): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(281,12): error TS2300: Duplicate identifier 'pgF'.
tests/cases/compiler/giant.ts(282,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(282,16): error TS2300: Duplicate identifier 'pgF'.
@@ -147,7 +147,7 @@ tests/cases/compiler/giant.ts(383,10): error TS2304: Cannot find name 'p'.
tests/cases/compiler/giant.ts(384,9): error TS1021: An index signature must have a type annotation.
tests/cases/compiler/giant.ts(385,10): error TS1096: An index signature must have exactly one parameter.
tests/cases/compiler/giant.ts(398,9): error TS2386: Overload signatures must all be optional or required.
tests/cases/compiler/giant.ts(412,39): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(412,39): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(424,16): error TS2300: Duplicate identifier 'pgF'.
tests/cases/compiler/giant.ts(425,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(425,20): error TS2300: Duplicate identifier 'pgF'.
@@ -171,98 +171,98 @@ tests/cases/compiler/giant.ts(462,10): error TS2304: Cannot find name 'p'.
tests/cases/compiler/giant.ts(463,9): error TS1021: An index signature must have a type annotation.
tests/cases/compiler/giant.ts(464,10): error TS1096: An index signature must have exactly one parameter.
tests/cases/compiler/giant.ts(477,9): error TS2386: Overload signatures must all be optional or required.
tests/cases/compiler/giant.ts(491,39): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(496,35): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(498,24): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(501,21): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(502,22): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(491,39): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(496,35): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(498,24): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(501,21): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(502,22): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(503,16): error TS2300: Duplicate identifier 'pgF'.
tests/cases/compiler/giant.ts(503,22): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(503,22): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(504,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(504,20): error TS2300: Duplicate identifier 'pgF'.
tests/cases/compiler/giant.ts(505,16): error TS2300: Duplicate identifier 'psF'.
tests/cases/compiler/giant.ts(505,31): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(505,31): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(506,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(506,20): error TS2300: Duplicate identifier 'psF'.
tests/cases/compiler/giant.ts(507,17): error TS2300: Duplicate identifier 'rgF'.
tests/cases/compiler/giant.ts(507,23): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(507,23): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(508,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(508,21): error TS2300: Duplicate identifier 'rgF'.
tests/cases/compiler/giant.ts(509,17): error TS2300: Duplicate identifier 'rsF'.
tests/cases/compiler/giant.ts(509,32): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(509,32): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(510,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(510,21): error TS2300: Duplicate identifier 'rsF'.
tests/cases/compiler/giant.ts(512,21): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(512,21): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(513,16): error TS2300: Duplicate identifier 'tsF'.
tests/cases/compiler/giant.ts(513,31): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(513,31): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(514,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(514,20): error TS2300: Duplicate identifier 'tsF'.
tests/cases/compiler/giant.ts(515,16): error TS2300: Duplicate identifier 'tgF'.
tests/cases/compiler/giant.ts(515,22): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(515,22): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(516,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(516,20): error TS2300: Duplicate identifier 'tgF'.
tests/cases/compiler/giant.ts(520,22): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(520,22): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(520,25): error TS1036: Statements are not allowed in ambient contexts.
tests/cases/compiler/giant.ts(525,30): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(532,31): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(534,20): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(537,17): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(538,18): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(525,30): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(532,31): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(534,20): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(537,17): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(538,18): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(539,12): error TS2300: Duplicate identifier 'pgF'.
tests/cases/compiler/giant.ts(539,18): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(539,18): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(540,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(540,16): error TS2300: Duplicate identifier 'pgF'.
tests/cases/compiler/giant.ts(541,12): error TS2300: Duplicate identifier 'psF'.
tests/cases/compiler/giant.ts(541,27): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(541,27): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(542,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(542,16): error TS2300: Duplicate identifier 'psF'.
tests/cases/compiler/giant.ts(543,13): error TS2300: Duplicate identifier 'rgF'.
tests/cases/compiler/giant.ts(543,19): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(543,19): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(544,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(544,17): error TS2300: Duplicate identifier 'rgF'.
tests/cases/compiler/giant.ts(545,13): error TS2300: Duplicate identifier 'rsF'.
tests/cases/compiler/giant.ts(545,28): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(545,28): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(546,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(546,17): error TS2300: Duplicate identifier 'rsF'.
tests/cases/compiler/giant.ts(548,17): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(548,17): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(549,12): error TS2300: Duplicate identifier 'tsF'.
tests/cases/compiler/giant.ts(549,27): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(549,27): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(550,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(550,16): error TS2300: Duplicate identifier 'tsF'.
tests/cases/compiler/giant.ts(551,12): error TS2300: Duplicate identifier 'tgF'.
tests/cases/compiler/giant.ts(551,18): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(551,18): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(552,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(552,16): error TS2300: Duplicate identifier 'tgF'.
tests/cases/compiler/giant.ts(556,18): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(556,18): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(556,21): error TS1036: Statements are not allowed in ambient contexts.
tests/cases/compiler/giant.ts(558,24): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(561,21): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(563,21): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(558,24): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(561,21): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(563,21): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(587,9): error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
tests/cases/compiler/giant.ts(587,10): error TS2304: Cannot find name 'p'.
tests/cases/compiler/giant.ts(588,9): error TS1021: An index signature must have a type annotation.
tests/cases/compiler/giant.ts(589,10): error TS1096: An index signature must have exactly one parameter.
tests/cases/compiler/giant.ts(602,9): error TS2386: Overload signatures must all be optional or required.
tests/cases/compiler/giant.ts(606,22): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(606,22): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(606,25): error TS1036: Statements are not allowed in ambient contexts.
tests/cases/compiler/giant.ts(611,30): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(611,30): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(615,16): error TS1038: A 'declare' modifier cannot be used in an already ambient context.
tests/cases/compiler/giant.ts(616,16): error TS1038: A 'declare' modifier cannot be used in an already ambient context.
tests/cases/compiler/giant.ts(616,39): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(616,39): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(617,16): error TS1038: A 'declare' modifier cannot be used in an already ambient context.
tests/cases/compiler/giant.ts(618,16): error TS1038: A 'declare' modifier cannot be used in an already ambient context.
tests/cases/compiler/giant.ts(621,26): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(623,24): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(626,21): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(628,21): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(621,26): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(623,24): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(626,21): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(628,21): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(653,9): error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
tests/cases/compiler/giant.ts(653,10): error TS2304: Cannot find name 'p'.
tests/cases/compiler/giant.ts(654,9): error TS1021: An index signature must have a type annotation.
tests/cases/compiler/giant.ts(655,10): error TS1096: An index signature must have exactly one parameter.
tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all be optional or required.
tests/cases/compiler/giant.ts(672,22): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(672,22): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(672,25): error TS1036: Statements are not allowed in ambient contexts.
tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(676,30): error TS1183: An implementation cannot be declared in ambient contexts.
==== tests/cases/compiler/giant.ts (265 errors) ====
@@ -513,7 +513,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
export declare var eaV;
export declare function eaF() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
export declare class eaC { };
export declare module eaM { };
}
@@ -640,31 +640,31 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
export declare var eaV;
export declare function eaF() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
export declare class eaC { };
export declare module eaM { };
}
export declare var eaV;
export declare function eaF() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
export declare class eaC {
constructor () { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
public pV;
private rV;
public pF() { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
private rF() { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
public pgF() { }
~~~
!!! error TS2300: Duplicate identifier 'pgF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
public get pgF()
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -674,7 +674,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
~~~
!!! error TS2300: Duplicate identifier 'psF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
public set psF(param:any)
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -684,7 +684,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
~~~
!!! error TS2300: Duplicate identifier 'rgF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
private get rgF()
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -694,7 +694,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
~~~
!!! error TS2300: Duplicate identifier 'rsF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
private set rsF(param:any)
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -703,12 +703,12 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
static tV;
static tF() { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
static tsF(param:any) { }
~~~
!!! error TS2300: Duplicate identifier 'tsF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
static set tsF(param:any)
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -718,7 +718,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
~~~
!!! error TS2300: Duplicate identifier 'tgF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
static get tgF()
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -729,7 +729,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
var V;
function F() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
~
!!! error TS1036: Statements are not allowed in ambient contexts.
class C { }
@@ -738,7 +738,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
export var eV;
export function eF() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
export class eC { }
export interface eI { }
export module eM { }
@@ -977,7 +977,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
export declare var eaV;
export declare function eaF() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
export declare class eaC { };
export declare module eaM { };
}
@@ -1104,31 +1104,31 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
export declare var eaV;
export declare function eaF() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
export declare class eaC { };
export declare module eaM { };
}
export declare var eaV;
export declare function eaF() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
export declare class eaC {
constructor () { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
public pV;
private rV;
public pF() { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
private rF() { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
public pgF() { }
~~~
!!! error TS2300: Duplicate identifier 'pgF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
public get pgF()
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -1138,7 +1138,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
~~~
!!! error TS2300: Duplicate identifier 'psF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
public set psF(param:any)
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -1148,7 +1148,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
~~~
!!! error TS2300: Duplicate identifier 'rgF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
private get rgF()
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -1158,7 +1158,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
~~~
!!! error TS2300: Duplicate identifier 'rsF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
private set rsF(param:any)
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -1167,12 +1167,12 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
static tV;
static tF() { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
static tsF(param:any) { }
~~~
!!! error TS2300: Duplicate identifier 'tsF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
static set tsF(param:any)
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -1182,7 +1182,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
~~~
!!! error TS2300: Duplicate identifier 'tgF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
static get tgF()
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -1193,7 +1193,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
var V;
function F() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
~
!!! error TS1036: Statements are not allowed in ambient contexts.
class C { }
@@ -1202,7 +1202,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
export var eV;
export function eF() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
export class eC { }
export interface eI { }
export module eM { }
@@ -1211,24 +1211,24 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
export declare var eaV;
export declare function eaF() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
export declare class eaC {
constructor () { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
public pV;
private rV;
public pF() { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
private rF() { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
public pgF() { }
~~~
!!! error TS2300: Duplicate identifier 'pgF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
public get pgF()
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -1238,7 +1238,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
~~~
!!! error TS2300: Duplicate identifier 'psF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
public set psF(param:any)
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -1248,7 +1248,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
~~~
!!! error TS2300: Duplicate identifier 'rgF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
private get rgF()
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -1258,7 +1258,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
~~~
!!! error TS2300: Duplicate identifier 'rsF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
private set rsF(param:any)
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -1267,12 +1267,12 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
static tV;
static tF() { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
static tsF(param:any) { }
~~~
!!! error TS2300: Duplicate identifier 'tsF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
static set tsF(param:any)
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -1282,7 +1282,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
~~~
!!! error TS2300: Duplicate identifier 'tgF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
static get tgF()
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -1293,22 +1293,22 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
var V;
function F() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
~
!!! error TS1036: Statements are not allowed in ambient contexts.
class C {
constructor () { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
public pV;
private rV;
public pF() { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
static tV;
static tF() { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
}
interface I {
//Call Signature
@@ -1363,7 +1363,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
var V;
function F() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
~
!!! error TS1036: Statements are not allowed in ambient contexts.
class C { }
@@ -1372,7 +1372,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
export var eV;
export function eF() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
export class eC { }
export interface eI { }
export module eM { }
@@ -1383,7 +1383,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
~~~~~~~
!!! error TS1038: A 'declare' modifier cannot be used in an already ambient context.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
export declare class eaC { }
~~~~~~~
!!! error TS1038: A 'declare' modifier cannot be used in an already ambient context.
@@ -1394,20 +1394,20 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
export var eV;
export function eF() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
export class eC {
constructor () { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
public pV;
private rV;
public pF() { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
static tV
static tF() { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
}
export interface eI {
//Call Signature
@@ -1463,7 +1463,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
var V;
function F() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
~
!!! error TS1036: Statements are not allowed in ambient contexts.
class C { }
@@ -1471,7 +1471,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
export var eV;
export function eF() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
export class eC { }
export interface eI { }
export module eM { }
@@ -1,6 +1,6 @@
tests/cases/conformance/externalModules/file1.d.ts(5,9): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/conformance/externalModules/file1.d.ts(6,16): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/conformance/externalModules/file1.d.ts(7,16): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/externalModules/file1.d.ts(7,16): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/externalModules/file1.d.ts(12,15): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/conformance/externalModules/file1.d.ts(13,15): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/conformance/externalModules/file1.d.ts(16,2): error TS1036: Statements are not allowed in ambient contexts.
@@ -20,7 +20,7 @@ tests/cases/conformance/externalModules/file1.d.ts(18,16): error TS1039: Initial
!!! error TS1039: Initializers are not allowed in ambient contexts.
fn(): boolean {
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
return false;
}
}
@@ -1,7 +1,7 @@
error TS5054: Could not write file 'tests/cases/compiler/b.js' which is one of the input files.
error TS5055: Could not write file 'tests/cases/compiler/b.js' which is one of the input files.
!!! error TS5054: Could not write file 'tests/cases/compiler/b.js' which is one of the input files.
!!! error TS5055: Could not write file 'tests/cases/compiler/b.js' which is one of the input files.
==== tests/cases/compiler/a.ts (0 errors) ====
class c {
}
@@ -1,5 +1,5 @@
tests/cases/compiler/methodInAmbientClass1.ts(2,12): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
tests/cases/compiler/methodInAmbientClass1.ts(2,20): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/methodInAmbientClass1.ts(2,20): error TS1183: An implementation cannot be declared in ambient contexts.
==== tests/cases/compiler/methodInAmbientClass1.ts (2 errors) ====
@@ -8,6 +8,6 @@ tests/cases/compiler/methodInAmbientClass1.ts(2,20): error TS1184: An implementa
~~~~~~~
!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
}
}
@@ -1,4 +1,4 @@
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration18.ts(4,25): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration18.ts(4,25): error TS1183: An implementation cannot be declared in ambient contexts.
==== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration18.ts (1 errors) ====
@@ -7,7 +7,7 @@ tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclarat
constructor(n: number);
constructor(x: any) {
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
}
bar1():void;
}
@@ -1,5 +1,5 @@
tests/cases/conformance/parser/ecmascript5/ConstructorDeclarations/parserConstructorDeclaration4.ts(2,3): error TS1031: 'declare' modifier cannot appear on a class element.
tests/cases/conformance/parser/ecmascript5/ConstructorDeclarations/parserConstructorDeclaration4.ts(2,25): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/parser/ecmascript5/ConstructorDeclarations/parserConstructorDeclaration4.ts(2,25): error TS1183: An implementation cannot be declared in ambient contexts.
==== tests/cases/conformance/parser/ecmascript5/ConstructorDeclarations/parserConstructorDeclaration4.ts (2 errors) ====
@@ -8,5 +8,5 @@ tests/cases/conformance/parser/ecmascript5/ConstructorDeclarations/parserConstru
~~~~~~~
!!! error TS1031: 'declare' modifier cannot appear on a class element.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
}
@@ -1,5 +1,5 @@
tests/cases/conformance/parser/ecmascript5/FunctionDeclarations/parserFunctionDeclaration2.d.ts(1,1): error TS1046: A 'declare' modifier is required for a top level declaration in a .d.ts file.
tests/cases/conformance/parser/ecmascript5/FunctionDeclarations/parserFunctionDeclaration2.d.ts(1,14): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/parser/ecmascript5/FunctionDeclarations/parserFunctionDeclaration2.d.ts(1,14): error TS1183: An implementation cannot be declared in ambient contexts.
==== tests/cases/conformance/parser/ecmascript5/FunctionDeclarations/parserFunctionDeclaration2.d.ts (2 errors) ====
@@ -7,5 +7,5 @@ tests/cases/conformance/parser/ecmascript5/FunctionDeclarations/parserFunctionDe
~~~~~~~~
!!! error TS1046: A 'declare' modifier is required for a top level declaration in a .d.ts file.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
}
@@ -1,8 +1,8 @@
tests/cases/conformance/parser/ecmascript5/FunctionDeclarations/parserFunctionDeclaration2.ts(1,24): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/parser/ecmascript5/FunctionDeclarations/parserFunctionDeclaration2.ts(1,24): error TS1183: An implementation cannot be declared in ambient contexts.
==== tests/cases/conformance/parser/ecmascript5/FunctionDeclarations/parserFunctionDeclaration2.ts (1 errors) ====
declare function Foo() {
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
}
@@ -1,5 +1,5 @@
tests/cases/conformance/parser/ecmascript5/MemberFunctionDeclarations/parserMemberFunctionDeclaration5.ts(2,5): error TS1031: 'declare' modifier cannot appear on a class element.
tests/cases/conformance/parser/ecmascript5/MemberFunctionDeclarations/parserMemberFunctionDeclaration5.ts(2,19): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/parser/ecmascript5/MemberFunctionDeclarations/parserMemberFunctionDeclaration5.ts(2,19): error TS1183: An implementation cannot be declared in ambient contexts.
==== tests/cases/conformance/parser/ecmascript5/MemberFunctionDeclarations/parserMemberFunctionDeclaration5.ts (2 errors) ====
@@ -8,5 +8,5 @@ tests/cases/conformance/parser/ecmascript5/MemberFunctionDeclarations/parserMemb
~~~~~~~
!!! error TS1031: 'declare' modifier cannot appear on a class element.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
}
@@ -0,0 +1,47 @@
// @noImplicitAny: true
interface A {
numProp: number;
}
interface B {
strProp: string;
}
interface Foo {
method1(arg: A): void;
method2(arg: B): void;
}
function getFoo1(): Foo {
return class {
static method1(arg) {
arg.numProp = 10;
}
static method2(arg) {
arg.strProp = "hello";
}
}
}
function getFoo2(): Foo {
return class {
static method1 = (arg) => {
arg.numProp = 10;
}
static method2 = (arg) => {
arg.strProp = "hello";
}
}
}
function getFoo3(): Foo {
return class {
static method1 = function (arg) {
arg.numProp = 10;
}
static method2 = function (arg) {
arg.strProp = "hello";
}
}
}
@@ -0,0 +1,51 @@
// @noImplicitAny: true
interface A {
numProp: number;
}
interface B {
strProp: string;
}
interface Foo {
new (): Bar;
}
interface Bar {
method1(arg: A): void;
method2(arg: B): void;
}
function getFoo1(): Foo {
return class {
method1(arg) {
arg.numProp = 10;
}
method2(arg) {
arg.strProp = "hello";
}
}
}
function getFoo2(): Foo {
return class {
method1 = (arg) => {
arg.numProp = 10;
}
method2 = (arg) => {
arg.strProp = "hello";
}
}
}
function getFoo3(): Foo {
return class {
method1 = function (arg) {
arg.numProp = 10;
}
method2 = function (arg) {
arg.strProp = "hello";
}
}
}
@@ -0,0 +1,47 @@
// @noImplicitAny: true
interface A {
numProp: number;
}
interface B {
strProp: string;
}
interface Foo {
method1(arg: A): void;
method2(arg: B): void;
}
function getFoo1(): Foo {
return {
method1(arg) {
arg.numProp = 10;
},
method2(arg) {
arg.strProp = "hello";
}
}
}
function getFoo2(): Foo {
return {
method1: (arg) => {
arg.numProp = 10;
},
method2: (arg) => {
arg.strProp = "hello";
}
}
}
function getFoo3(): Foo {
return {
method1: function (arg) {
arg.numProp = 10;
},
method2: function (arg) {
arg.strProp = "hello";
}
}
}
@@ -0,0 +1,32 @@
/// <reference path="fourslash.ts" />
// @noImplicitAny: true
////interface A {
//// numProp: number;
////}
////
////interface B {
//// strProp: string;
////}
////
////interface Foo {
//// method1(arg: A): void;
//// method2(arg: B): void;
////}
////
////function getFoo1(): Foo {
//// return {
//// method1(/*param1*/arg) {
//// arg.numProp = 10;
//// },
//// method2(/*param2*/arg) {
//// arg.strProp = "hello";
//// }
//// }
////}
goTo.marker("param1");
verify.quickInfoIs("(parameter) arg: A")
goTo.marker("param2");
verify.quickInfoIs("(parameter) arg: B")