merge with master
This commit is contained in:
commit
d8ec703370
19
Jakefile.js
19
Jakefile.js
|
@ -630,10 +630,9 @@ function deleteTemporaryProjectOutput() {
|
|||
|
||||
var testTimeout = 20000;
|
||||
desc("Runs the tests using the built run.js file. Syntax is jake runtests. Optional parameters 'host=', 'tests=[regex], reporter=[list|spec|json|<more>]', debug=true.");
|
||||
task("runtests", ["tests", builtLocalDirectory], function() {
|
||||
task("runtests", ["build-rules", "tests", builtLocalDirectory], function() {
|
||||
cleanTestDirs();
|
||||
var debug = process.env.debug || process.env.d;
|
||||
host = "mocha"
|
||||
tests = process.env.test || process.env.tests || process.env.t;
|
||||
var light = process.env.light || false;
|
||||
var testConfigFile = 'test.config';
|
||||
|
@ -655,9 +654,16 @@ task("runtests", ["tests", builtLocalDirectory], function() {
|
|||
reporter = process.env.reporter || process.env.r || 'mocha-fivemat-progress-reporter';
|
||||
// timeout normally isn't necessary but Travis-CI has been timing out on compiler baselines occasionally
|
||||
// default timeout is 2sec which really should be enough, but maybe we just need a small amount longer
|
||||
var cmd = host + (debug ? " --debug-brk" : "") + " -R " + reporter + tests + colors + ' -t ' + testTimeout + ' ' + run;
|
||||
var cmd = "mocha" + (debug ? " --debug-brk" : "") + " -R " + reporter + tests + colors + ' -t ' + testTimeout + ' ' + run;
|
||||
console.log(cmd);
|
||||
exec(cmd, deleteTemporaryProjectOutput);
|
||||
exec(cmd, function() {
|
||||
deleteTemporaryProjectOutput();
|
||||
var lint = jake.Task['lint'];
|
||||
lint.addListener('complete', function () {
|
||||
complete();
|
||||
});
|
||||
lint.invoke();
|
||||
});
|
||||
}, {async: true});
|
||||
|
||||
desc("Generates code coverage data via instanbul");
|
||||
|
@ -815,7 +821,6 @@ task("update-sublime", ["local", serverFile], function() {
|
|||
var tslintRuleDir = "scripts/tslint";
|
||||
var tslintRules = ([
|
||||
"nextLineRule",
|
||||
"noInferrableTypesRule",
|
||||
"noNullRule",
|
||||
"booleanTriviaRule"
|
||||
]);
|
||||
|
@ -828,7 +833,7 @@ var tslintRulesOutFiles = tslintRules.map(function(p) {
|
|||
desc("Compiles tslint rules to js");
|
||||
task("build-rules", tslintRulesOutFiles);
|
||||
tslintRulesFiles.forEach(function(ruleFile, i) {
|
||||
compileFile(tslintRulesOutFiles[i], [ruleFile], [ruleFile], [], /*useBuiltCompiler*/ true, /*noOutFile*/ true, /*generateDeclarations*/ false, path.join(builtLocalDirectory, "tslint"));
|
||||
compileFile(tslintRulesOutFiles[i], [ruleFile], [ruleFile], [], /*useBuiltCompiler*/ false, /*noOutFile*/ true, /*generateDeclarations*/ false, path.join(builtLocalDirectory, "tslint"));
|
||||
});
|
||||
|
||||
function getLinterOptions() {
|
||||
|
@ -862,8 +867,6 @@ function lintFileAsync(options, path, cb) {
|
|||
|
||||
var lintTargets = compilerSources.concat(harnessCoreSources);
|
||||
|
||||
// if the codebase were free of linter errors we could make jake runtests
|
||||
// run this task automatically
|
||||
desc("Runs tslint on the compiler sources");
|
||||
task("lint", ["build-rules"], function() {
|
||||
var lintOptions = getLinterOptions();
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
},
|
||||
"scripts": {
|
||||
"pretest": "jake tests",
|
||||
"test": "jake runtests && npm run lint",
|
||||
"test": "jake runtests",
|
||||
"build": "npm run build:compiler && npm run build:tests",
|
||||
"build:compiler": "jake local",
|
||||
"build:tests": "jake tests",
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
/// <reference path="../../node_modules/tslint/typings/typescriptServices.d.ts" />
|
||||
/// <reference path="../../node_modules/tslint/lib/tslint.d.ts" />
|
||||
|
||||
|
||||
export class Rule extends Lint.Rules.AbstractRule {
|
||||
public static FAILURE_STRING_FACTORY = (type: string) => `LHS type (${type}) inferred by RHS expression, remove type annotation`;
|
||||
|
||||
public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] {
|
||||
return this.applyWithWalker(new InferrableTypeWalker(sourceFile, this.getOptions()));
|
||||
}
|
||||
}
|
||||
|
||||
class InferrableTypeWalker extends Lint.RuleWalker {
|
||||
visitVariableStatement(node: ts.VariableStatement) {
|
||||
node.declarationList.declarations.forEach(e => {
|
||||
if ((!!e.type) && (!!e.initializer)) {
|
||||
let failure: string;
|
||||
switch (e.type.kind) {
|
||||
case ts.SyntaxKind.BooleanKeyword:
|
||||
if (e.initializer.kind === ts.SyntaxKind.TrueKeyword || e.initializer.kind === ts.SyntaxKind.FalseKeyword) {
|
||||
failure = 'boolean';
|
||||
}
|
||||
break;
|
||||
case ts.SyntaxKind.NumberKeyword:
|
||||
if (e.initializer.kind === ts.SyntaxKind.NumericLiteral) {
|
||||
failure = 'number';
|
||||
}
|
||||
break;
|
||||
case ts.SyntaxKind.StringKeyword:
|
||||
switch (e.initializer.kind) {
|
||||
case ts.SyntaxKind.StringLiteral:
|
||||
case ts.SyntaxKind.NoSubstitutionTemplateLiteral:
|
||||
case ts.SyntaxKind.TemplateExpression:
|
||||
failure = 'string';
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (failure) {
|
||||
this.addFailure(this.createFailure(e.type.getStart(), e.type.getWidth(), Rule.FAILURE_STRING_FACTORY(failure)));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
super.visitVariableStatement(node);
|
||||
}
|
||||
}
|
|
@ -3171,8 +3171,8 @@ namespace ts {
|
|||
members = createInstantiatedSymbolTable(source.declaredProperties, mapper, /*mappingThisOnly*/ typeParameters.length === 1);
|
||||
callSignatures = instantiateList(source.declaredCallSignatures, mapper, instantiateSignature);
|
||||
constructSignatures = instantiateList(source.declaredConstructSignatures, mapper, instantiateSignature);
|
||||
stringIndexType = source.declaredStringIndexType ? instantiateType(source.declaredStringIndexType, mapper) : undefined;
|
||||
numberIndexType = source.declaredNumberIndexType ? instantiateType(source.declaredNumberIndexType, mapper) : undefined;
|
||||
stringIndexType = instantiateType(source.declaredStringIndexType, mapper);
|
||||
numberIndexType = instantiateType(source.declaredNumberIndexType, mapper);
|
||||
}
|
||||
let baseTypes = getBaseTypes(source);
|
||||
if (baseTypes.length) {
|
||||
|
@ -3371,7 +3371,7 @@ namespace ts {
|
|||
setObjectTypeMembers(type, emptySymbols, callSignatures, constructSignatures, stringIndexType, numberIndexType);
|
||||
}
|
||||
|
||||
function resolveAnonymousTypeMembers(type: ObjectType) {
|
||||
function resolveAnonymousTypeMembers(type: AnonymousType) {
|
||||
let symbol = type.symbol;
|
||||
let members: SymbolTable;
|
||||
let callSignatures: Signature[];
|
||||
|
@ -3379,7 +3379,14 @@ namespace ts {
|
|||
let stringIndexType: Type;
|
||||
let numberIndexType: Type;
|
||||
|
||||
if (symbol.flags & SymbolFlags.TypeLiteral) {
|
||||
if (type.target) {
|
||||
members = createInstantiatedSymbolTable(getPropertiesOfObjectType(type.target), type.mapper, /*mappingThisOnly*/ false);
|
||||
callSignatures = instantiateList(getSignaturesOfType(type.target, SignatureKind.Call), type.mapper, instantiateSignature);
|
||||
constructSignatures = instantiateList(getSignaturesOfType(type.target, SignatureKind.Construct), type.mapper, instantiateSignature);
|
||||
stringIndexType = instantiateType(getIndexTypeOfType(type.target, IndexKind.String), type.mapper);
|
||||
numberIndexType = instantiateType(getIndexTypeOfType(type.target, IndexKind.Number), type.mapper);
|
||||
}
|
||||
else if (symbol.flags & SymbolFlags.TypeLiteral) {
|
||||
members = symbol.members;
|
||||
callSignatures = getSignaturesOfSymbol(members["__call"]);
|
||||
constructSignatures = getSignaturesOfSymbol(members["__new"]);
|
||||
|
@ -3424,7 +3431,7 @@ namespace ts {
|
|||
resolveClassOrInterfaceMembers(<InterfaceType>type);
|
||||
}
|
||||
else if (type.flags & TypeFlags.Anonymous) {
|
||||
resolveAnonymousTypeMembers(<ObjectType>type);
|
||||
resolveAnonymousTypeMembers(<AnonymousType>type);
|
||||
}
|
||||
else if (type.flags & TypeFlags.Tuple) {
|
||||
resolveTupleTypeMembers(<TupleType>type);
|
||||
|
@ -4543,7 +4550,7 @@ namespace ts {
|
|||
}
|
||||
let result = createSignature(signature.declaration, freshTypeParameters,
|
||||
instantiateList(signature.parameters, mapper, instantiateSymbol),
|
||||
signature.resolvedReturnType ? instantiateType(signature.resolvedReturnType, mapper) : undefined,
|
||||
instantiateType(signature.resolvedReturnType, mapper),
|
||||
freshTypePredicate,
|
||||
signature.minArgumentCount, signature.hasRestParameter, signature.hasStringLiterals);
|
||||
result.target = signature;
|
||||
|
@ -4575,7 +4582,7 @@ namespace ts {
|
|||
return result;
|
||||
}
|
||||
|
||||
function instantiateAnonymousType(type: ObjectType, mapper: TypeMapper): ObjectType {
|
||||
function instantiateAnonymousType(type: AnonymousType, mapper: TypeMapper): ObjectType {
|
||||
if (mapper.instantiations) {
|
||||
let cachedType = mapper.instantiations[type.id];
|
||||
if (cachedType) {
|
||||
|
@ -4586,27 +4593,21 @@ namespace ts {
|
|||
mapper.instantiations = [];
|
||||
}
|
||||
// Mark the anonymous type as instantiated such that our infinite instantiation detection logic can recognize it
|
||||
let result = <ResolvedType>createObjectType(TypeFlags.Anonymous | TypeFlags.Instantiated, type.symbol);
|
||||
result.properties = instantiateList(getPropertiesOfObjectType(type), mapper, instantiateSymbol);
|
||||
result.members = createSymbolTable(result.properties);
|
||||
result.callSignatures = instantiateList(getSignaturesOfType(type, SignatureKind.Call), mapper, instantiateSignature);
|
||||
result.constructSignatures = instantiateList(getSignaturesOfType(type, SignatureKind.Construct), mapper, instantiateSignature);
|
||||
let stringIndexType = getIndexTypeOfType(type, IndexKind.String);
|
||||
let numberIndexType = getIndexTypeOfType(type, IndexKind.Number);
|
||||
if (stringIndexType) result.stringIndexType = instantiateType(stringIndexType, mapper);
|
||||
if (numberIndexType) result.numberIndexType = instantiateType(numberIndexType, mapper);
|
||||
let result = <AnonymousType>createObjectType(TypeFlags.Anonymous | TypeFlags.Instantiated, type.symbol);
|
||||
result.target = type;
|
||||
result.mapper = mapper;
|
||||
mapper.instantiations[type.id] = result;
|
||||
return result;
|
||||
}
|
||||
|
||||
function instantiateType(type: Type, mapper: TypeMapper): Type {
|
||||
if (mapper !== identityMapper) {
|
||||
if (type && mapper !== identityMapper) {
|
||||
if (type.flags & TypeFlags.TypeParameter) {
|
||||
return mapper(<TypeParameter>type);
|
||||
}
|
||||
if (type.flags & TypeFlags.Anonymous) {
|
||||
return type.symbol && type.symbol.flags & (SymbolFlags.Function | SymbolFlags.Method | SymbolFlags.Class | SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral) ?
|
||||
instantiateAnonymousType(<ObjectType>type, mapper) : type;
|
||||
instantiateAnonymousType(<AnonymousType>type, mapper) : type;
|
||||
}
|
||||
if (type.flags & TypeFlags.Reference) {
|
||||
return createTypeReference((<TypeReference>type).target, instantiateList((<TypeReference>type).typeArguments, mapper, instantiateType));
|
||||
|
@ -7631,7 +7632,9 @@ namespace ts {
|
|||
// Look up the value in the current scope
|
||||
if (valueSymbol && valueSymbol !== unknownSymbol) {
|
||||
links.jsxFlags |= JsxFlags.ClassElement;
|
||||
getSymbolLinks(valueSymbol).referenced = true;
|
||||
if (valueSymbol.flags & SymbolFlags.Alias) {
|
||||
markAliasSymbolAsReferenced(valueSymbol);
|
||||
}
|
||||
}
|
||||
|
||||
return valueSymbol || unknownSymbol;
|
||||
|
@ -8564,6 +8567,12 @@ namespace ts {
|
|||
case SyntaxKind.SetAccessor:
|
||||
// A method or accessor declaration decorator will have two or three arguments (see
|
||||
// `PropertyDecorator` and `MethodDecorator` in core.d.ts)
|
||||
|
||||
// If we are emitting decorators for ES3, we will only pass two arguments.
|
||||
if (languageVersion === ScriptTarget.ES3) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
// If the method decorator signature only accepts a target and a key, we will only
|
||||
// type check those arguments.
|
||||
return signature.parameters.length >= 3 ? 3 : 2;
|
||||
|
@ -14224,7 +14233,21 @@ namespace ts {
|
|||
}
|
||||
|
||||
if (isHeritageClauseElementIdentifier(<EntityName>entityName)) {
|
||||
let meaning = entityName.parent.kind === SyntaxKind.ExpressionWithTypeArguments ? SymbolFlags.Type : SymbolFlags.Namespace;
|
||||
let meaning = SymbolFlags.None;
|
||||
|
||||
// In an interface or class, we're definitely interested in a type.
|
||||
if (entityName.parent.kind === SyntaxKind.ExpressionWithTypeArguments) {
|
||||
meaning = SymbolFlags.Type;
|
||||
|
||||
// In a class 'extends' clause we are also looking for a value.
|
||||
if (isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) {
|
||||
meaning |= SymbolFlags.Value;
|
||||
}
|
||||
}
|
||||
else {
|
||||
meaning = SymbolFlags.Namespace;
|
||||
}
|
||||
|
||||
meaning |= SymbolFlags.Alias;
|
||||
return resolveEntityName(<EntityName>entityName, meaning);
|
||||
}
|
||||
|
@ -14903,9 +14926,6 @@ namespace ts {
|
|||
if (!nodeCanBeDecorated(node)) {
|
||||
return grammarErrorOnFirstToken(node, Diagnostics.Decorators_are_not_valid_here);
|
||||
}
|
||||
else if (languageVersion < ScriptTarget.ES5) {
|
||||
return grammarErrorOnFirstToken(node, Diagnostics.Decorators_are_only_available_when_targeting_ECMAScript_5_and_higher);
|
||||
}
|
||||
else if (node.kind === SyntaxKind.GetAccessor || node.kind === SyntaxKind.SetAccessor) {
|
||||
let accessors = getAllAccessorDeclarations((<ClassDeclaration>node.parent).members, <AccessorDeclaration>node);
|
||||
if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) {
|
||||
|
|
|
@ -631,10 +631,6 @@
|
|||
"category": "Error",
|
||||
"code": 1204
|
||||
},
|
||||
"Decorators are only available when targeting ECMAScript 5 and higher.": {
|
||||
"category": "Error",
|
||||
"code": 1205
|
||||
},
|
||||
"Decorators are not valid here.": {
|
||||
"category": "Error",
|
||||
"code": 1206
|
||||
|
|
|
@ -285,12 +285,10 @@ var __extends = (this && this.__extends) || function (d, b) {
|
|||
// emit output for the __decorate helper function
|
||||
const decorateHelper = `
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};`;
|
||||
|
||||
// emit output for the __metadata helper function
|
||||
|
@ -448,7 +446,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
|||
/** If removeComments is true, no leading-comments needed to be emitted **/
|
||||
let emitLeadingCommentsOfPosition = compilerOptions.removeComments ? function (pos: number) { } : emitLeadingCommentsOfPositionWorker;
|
||||
|
||||
let moduleEmitDelegates: Map<(node: SourceFile, startIndex: number, resolvePath?: boolean) => void> = {
|
||||
let moduleEmitDelegates: Map<(node: SourceFile, resolvePath?: boolean) => void> = {
|
||||
[ModuleKind.ES6]: emitES6Module,
|
||||
[ModuleKind.AMD]: emitAMDModule,
|
||||
[ModuleKind.System]: emitSystemModule,
|
||||
|
@ -456,7 +454,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
|||
[ModuleKind.CommonJS]: emitCommonJSModule,
|
||||
};
|
||||
|
||||
let bundleEmitDelegates: Map<(node: SourceFile, startIndex: number, resolvePath?: boolean) => void> = {
|
||||
let bundleEmitDelegates: Map<(node: SourceFile, resolvePath?: boolean) => void> = {
|
||||
[ModuleKind.ES6]() {},
|
||||
[ModuleKind.AMD]: emitAMDModule,
|
||||
[ModuleKind.System]: emitSystemModule,
|
||||
|
@ -1674,7 +1672,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
|||
//
|
||||
// The emit for the decorated computed property decorator is:
|
||||
//
|
||||
// Object.defineProperty(C.prototype, _a, __decorate([dec], C.prototype, _a, Object.getOwnPropertyDescriptor(C.prototype, _a)));
|
||||
// __decorate([dec], C.prototype, _a, Object.getOwnPropertyDescriptor(C.prototype, _a));
|
||||
//
|
||||
if (nodeIsDecorated(node.parent)) {
|
||||
if (!computedPropertyNamesToGeneratedNames) {
|
||||
|
@ -4729,7 +4727,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
|||
//
|
||||
// let C = class {
|
||||
// };
|
||||
// Object.defineProperty(C, "name", { value: "C", configurable: true });
|
||||
// C = __decorate([dec], C);
|
||||
//
|
||||
// * For an exported class declaration:
|
||||
|
@ -4741,7 +4738,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
|||
//
|
||||
// export let C = class {
|
||||
// };
|
||||
// Object.defineProperty(C, "name", { value: "C", configurable: true });
|
||||
// C = __decorate([dec], C);
|
||||
//
|
||||
// * For a default export of a class declaration with a name:
|
||||
|
@ -4753,7 +4749,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
|||
//
|
||||
// let C = class {
|
||||
// }
|
||||
// Object.defineProperty(C, "name", { value: "C", configurable: true });
|
||||
// C = __decorate([dec], C);
|
||||
// export default C;
|
||||
//
|
||||
|
@ -5081,21 +5076,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
|||
//
|
||||
// The emit for a method is:
|
||||
//
|
||||
// Object.defineProperty(C.prototype, "method",
|
||||
// __decorate([
|
||||
// dec,
|
||||
// __param(0, dec2),
|
||||
// __metadata("design:type", Function),
|
||||
// __metadata("design:paramtypes", [Object]),
|
||||
// __metadata("design:returntype", void 0)
|
||||
// ], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method")));
|
||||
// __decorate([
|
||||
// dec,
|
||||
// __param(0, dec2),
|
||||
// __metadata("design:type", Function),
|
||||
// __metadata("design:paramtypes", [Object]),
|
||||
// __metadata("design:returntype", void 0)
|
||||
// ], C.prototype, "method", undefined);
|
||||
//
|
||||
// The emit for an accessor is:
|
||||
//
|
||||
// Object.defineProperty(C.prototype, "accessor",
|
||||
// __decorate([
|
||||
// dec
|
||||
// ], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor")));
|
||||
// __decorate([
|
||||
// dec
|
||||
// ], C.prototype, "accessor", undefined);
|
||||
//
|
||||
// The emit for a property is:
|
||||
//
|
||||
|
@ -5106,18 +5099,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
|||
|
||||
writeLine();
|
||||
emitStart(member);
|
||||
if (member.kind !== SyntaxKind.PropertyDeclaration) {
|
||||
write("Object.defineProperty(");
|
||||
emitStart(member.name);
|
||||
emitClassMemberPrefix(node, member);
|
||||
write(", ");
|
||||
emitExpressionForPropertyName(member.name);
|
||||
emitEnd(member.name);
|
||||
write(",");
|
||||
increaseIndent();
|
||||
writeLine();
|
||||
}
|
||||
|
||||
write("__decorate([");
|
||||
increaseIndent();
|
||||
writeLine();
|
||||
|
@ -5141,15 +5122,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
|||
emitExpressionForPropertyName(member.name);
|
||||
emitEnd(member.name);
|
||||
|
||||
if (member.kind !== SyntaxKind.PropertyDeclaration) {
|
||||
write(", Object.getOwnPropertyDescriptor(");
|
||||
emitStart(member.name);
|
||||
emitClassMemberPrefix(node, member);
|
||||
write(", ");
|
||||
emitExpressionForPropertyName(member.name);
|
||||
emitEnd(member.name);
|
||||
write("))");
|
||||
decreaseIndent();
|
||||
if (languageVersion > ScriptTarget.ES3) {
|
||||
if (member.kind !== SyntaxKind.PropertyDeclaration) {
|
||||
// We emit `null` here to indicate to `__decorate` that it can invoke `Object.getOwnPropertyDescriptor` directly.
|
||||
// We have this extra argument here so that we can inject an explicit property descriptor at a later date.
|
||||
write(", null");
|
||||
}
|
||||
else {
|
||||
// We emit `void 0` here to indicate to `__decorate` that it can invoke `Object.defineProperty` directly, but that it
|
||||
// should not invoke `Object.getOwnPropertyDescriptor`.
|
||||
write(", void 0");
|
||||
}
|
||||
}
|
||||
|
||||
write(");");
|
||||
|
@ -6633,7 +6616,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
|||
write("}"); // execute
|
||||
}
|
||||
|
||||
function emitSystemModule(node: SourceFile, startIndex: number, resolvePath?: boolean): void {
|
||||
function emitSystemModule(node: SourceFile, resolvePath?: boolean): void {
|
||||
collectExternalModuleInfo(node);
|
||||
// System modules has the following shape
|
||||
// System.register(['dep-1', ... 'dep-n'], function(exports) {/* module body function */})
|
||||
|
@ -6681,6 +6664,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
|||
write(`], function(${exportFunctionForFile}) {`);
|
||||
writeLine();
|
||||
increaseIndent();
|
||||
let startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ true);
|
||||
emitEmitHelpers(node);
|
||||
emitCaptureThisForNodeIfNecessary(node);
|
||||
emitSystemModuleBody(node, dependencyGroups, startIndex);
|
||||
|
@ -6778,7 +6762,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
|||
write(") {");
|
||||
}
|
||||
|
||||
function emitAMDModule(node: SourceFile, startIndex: number, resolvePath?: boolean) {
|
||||
function emitAMDModule(node: SourceFile, resolvePath?: boolean) {
|
||||
emitEmitHelpers(node);
|
||||
collectExternalModuleInfo(node);
|
||||
|
||||
|
@ -6789,6 +6773,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
|||
}
|
||||
emitAMDDependencies(node, /*includeNonAmdDependencies*/ true, resolvePath);
|
||||
increaseIndent();
|
||||
let startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ true);
|
||||
emitExportStarHelper();
|
||||
emitCaptureThisForNodeIfNecessary(node);
|
||||
emitLinesStartingAt(node.statements, startIndex);
|
||||
|
@ -6799,7 +6784,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
|||
write("});");
|
||||
}
|
||||
|
||||
function emitCommonJSModule(node: SourceFile, startIndex: number) {
|
||||
function emitCommonJSModule(node: SourceFile) {
|
||||
let startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ false);
|
||||
emitEmitHelpers(node);
|
||||
collectExternalModuleInfo(node);
|
||||
emitExportStarHelper();
|
||||
|
@ -6809,7 +6795,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
|||
emitExportEquals(/*emitAsReturn*/ false);
|
||||
}
|
||||
|
||||
function emitUMDModule(node: SourceFile, startIndex: number) {
|
||||
function emitUMDModule(node: SourceFile) {
|
||||
emitEmitHelpers(node);
|
||||
collectExternalModuleInfo(node);
|
||||
|
||||
|
@ -6828,6 +6814,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
|||
})(`);
|
||||
emitAMDFactoryHeader(dependencyNames);
|
||||
increaseIndent();
|
||||
let startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ true);
|
||||
emitExportStarHelper();
|
||||
emitCaptureThisForNodeIfNecessary(node);
|
||||
emitLinesStartingAt(node.statements, startIndex);
|
||||
|
@ -6838,11 +6825,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
|||
write("});");
|
||||
}
|
||||
|
||||
function emitES6Module(node: SourceFile, startIndex: number) {
|
||||
function emitES6Module(node: SourceFile) {
|
||||
externalImports = undefined;
|
||||
exportSpecifiers = undefined;
|
||||
exportEquals = undefined;
|
||||
hasExportStars = false;
|
||||
let startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ false);
|
||||
emitEmitHelpers(node);
|
||||
emitCaptureThisForNodeIfNecessary(node);
|
||||
emitLinesStartingAt(node.statements, startIndex);
|
||||
|
@ -7031,19 +7019,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
|||
emitShebang();
|
||||
emitDetachedComments(node);
|
||||
|
||||
// emit prologue directives prior to __extends
|
||||
let startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ false);
|
||||
|
||||
if (isExternalModule(node) || compilerOptions.isolatedModules) {
|
||||
if (root || (!isExternalModule(node) && compilerOptions.isolatedModules)) {
|
||||
let emitModule = moduleEmitDelegates[modulekind] || moduleEmitDelegates[ModuleKind.CommonJS];
|
||||
emitModule(node, startIndex);
|
||||
emitModule(node);
|
||||
}
|
||||
else {
|
||||
bundleEmitDelegates[modulekind](node, startIndex, /*resolvePath*/true);
|
||||
bundleEmitDelegates[modulekind](node, /*resolvePath*/true);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// emit prologue directives prior to __extends
|
||||
let startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ false);
|
||||
externalImports = undefined;
|
||||
exportSpecifiers = undefined;
|
||||
exportEquals = undefined;
|
||||
|
|
|
@ -856,7 +856,7 @@ namespace ts {
|
|||
let saveParseErrorBeforeNextFinishedNode = parseErrorBeforeNextFinishedNode;
|
||||
|
||||
// Note: it is not actually necessary to save/restore the context flags here. That's
|
||||
// because the saving/restorating of these flags happens naturally through the recursive
|
||||
// because the saving/restoring of these flags happens naturally through the recursive
|
||||
// descent nature of our parser. However, we still store this here just so we can
|
||||
// assert that that invariant holds.
|
||||
let saveContextFlags = contextFlags;
|
||||
|
@ -1124,7 +1124,15 @@ namespace ts {
|
|||
if (token === SyntaxKind.DefaultKeyword) {
|
||||
return nextTokenIsClassOrFunction();
|
||||
}
|
||||
if (token === SyntaxKind.StaticKeyword) {
|
||||
nextToken();
|
||||
return canFollowModifier();
|
||||
}
|
||||
|
||||
nextToken();
|
||||
if (scanner.hasPrecedingLineBreak()) {
|
||||
return false;
|
||||
}
|
||||
return canFollowModifier();
|
||||
}
|
||||
|
||||
|
@ -4157,8 +4165,12 @@ namespace ts {
|
|||
case SyntaxKind.ModuleKeyword:
|
||||
case SyntaxKind.NamespaceKeyword:
|
||||
return nextTokenIsIdentifierOrStringLiteralOnSameLine();
|
||||
case SyntaxKind.AbstractKeyword:
|
||||
case SyntaxKind.AsyncKeyword:
|
||||
case SyntaxKind.DeclareKeyword:
|
||||
case SyntaxKind.PrivateKeyword:
|
||||
case SyntaxKind.ProtectedKeyword:
|
||||
case SyntaxKind.PublicKeyword:
|
||||
nextToken();
|
||||
// ASI takes effect for this modifier.
|
||||
if (scanner.hasPrecedingLineBreak()) {
|
||||
|
@ -4178,11 +4190,7 @@ namespace ts {
|
|||
}
|
||||
continue;
|
||||
|
||||
case SyntaxKind.PublicKeyword:
|
||||
case SyntaxKind.PrivateKeyword:
|
||||
case SyntaxKind.ProtectedKeyword:
|
||||
case SyntaxKind.StaticKeyword:
|
||||
case SyntaxKind.AbstractKeyword:
|
||||
nextToken();
|
||||
continue;
|
||||
default:
|
||||
|
|
|
@ -8,7 +8,7 @@ namespace ts {
|
|||
write(s: string): void;
|
||||
readFile(path: string, encoding?: string): string;
|
||||
writeFile(path: string, data: string, writeByteOrderMark?: boolean): void;
|
||||
watchFile?(path: string, callback: (path: string) => void): FileWatcher;
|
||||
watchFile?(path: string, callback: (path: string, removed: boolean) => void): FileWatcher;
|
||||
resolvePath(path: string): string;
|
||||
fileExists(path: string): boolean;
|
||||
directoryExists(path: string): boolean;
|
||||
|
@ -292,11 +292,16 @@ namespace ts {
|
|||
};
|
||||
|
||||
function fileChanged(curr: any, prev: any) {
|
||||
// mtime.getTime() equals 0 if file was removed
|
||||
if (curr.mtime.getTime() === 0) {
|
||||
callback(fileName, /* removed */ true);
|
||||
return;
|
||||
}
|
||||
if (+curr.mtime <= +prev.mtime) {
|
||||
return;
|
||||
}
|
||||
|
||||
callback(fileName);
|
||||
callback(fileName, /* removed */ false);
|
||||
}
|
||||
},
|
||||
resolvePath: function (path: string): string {
|
||||
|
|
|
@ -275,7 +275,7 @@ namespace ts {
|
|||
let sourceFile = hostGetSourceFile(fileName, languageVersion, onError);
|
||||
if (sourceFile && compilerOptions.watch) {
|
||||
// Attach a file watcher
|
||||
sourceFile.fileWatcher = sys.watchFile(sourceFile.fileName, () => sourceFileChanged(sourceFile));
|
||||
sourceFile.fileWatcher = sys.watchFile(sourceFile.fileName, (fileName, removed) => sourceFileChanged(sourceFile, removed));
|
||||
}
|
||||
return sourceFile;
|
||||
}
|
||||
|
@ -297,9 +297,15 @@ namespace ts {
|
|||
}
|
||||
|
||||
// If a source file changes, mark it as unwatched and start the recompilation timer
|
||||
function sourceFileChanged(sourceFile: SourceFile) {
|
||||
function sourceFileChanged(sourceFile: SourceFile, removed: boolean) {
|
||||
sourceFile.fileWatcher.close();
|
||||
sourceFile.fileWatcher = undefined;
|
||||
if (removed) {
|
||||
let index = rootFileNames.indexOf(sourceFile.fileName);
|
||||
if (index >= 0) {
|
||||
rootFileNames.splice(index, 1);
|
||||
}
|
||||
}
|
||||
startTimer();
|
||||
}
|
||||
|
||||
|
@ -531,8 +537,8 @@ namespace ts {
|
|||
|
||||
return;
|
||||
|
||||
function serializeCompilerOptions(options: CompilerOptions): Map<string|number|boolean> {
|
||||
let result: Map<string|number|boolean> = {};
|
||||
function serializeCompilerOptions(options: CompilerOptions): Map<string | number | boolean> {
|
||||
let result: Map<string | number | boolean> = {};
|
||||
let optionsNameMap = getOptionNameMap().optionNameMap;
|
||||
|
||||
for (let name in options) {
|
||||
|
|
|
@ -1880,7 +1880,7 @@ namespace ts {
|
|||
}
|
||||
|
||||
export interface TupleType extends ObjectType {
|
||||
elementTypes: Type[]; // Element types
|
||||
elementTypes: Type[]; // Element types
|
||||
}
|
||||
|
||||
export interface UnionOrIntersectionType extends Type {
|
||||
|
@ -1895,6 +1895,13 @@ namespace ts {
|
|||
|
||||
export interface IntersectionType extends UnionOrIntersectionType { }
|
||||
|
||||
/* @internal */
|
||||
// An instantiated anonymous type has a target and a mapper
|
||||
export interface AnonymousType extends ObjectType {
|
||||
target?: AnonymousType; // Instantiation target
|
||||
mapper?: TypeMapper; // Instantiation mapper
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
// Resolved object, union, or intersection type
|
||||
export interface ResolvedType extends ObjectType, UnionOrIntersectionType {
|
||||
|
|
|
@ -986,6 +986,7 @@ namespace ts {
|
|||
return node === (<ComputedPropertyName>parent).expression;
|
||||
case SyntaxKind.Decorator:
|
||||
case SyntaxKind.JsxExpression:
|
||||
case SyntaxKind.JsxSpreadAttribute:
|
||||
return true;
|
||||
case SyntaxKind.ExpressionWithTypeArguments:
|
||||
return (<ExpressionWithTypeArguments>parent).expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent);
|
||||
|
|
|
@ -157,7 +157,7 @@ namespace FourSlash {
|
|||
return true;
|
||||
}
|
||||
|
||||
public setCancelled(numberOfCalls: number = 0): void {
|
||||
public setCancelled(numberOfCalls = 0): void {
|
||||
ts.Debug.assert(numberOfCalls >= 0);
|
||||
this.numberOfCallsBeforeCancellation = numberOfCalls;
|
||||
}
|
||||
|
@ -761,7 +761,7 @@ namespace FourSlash {
|
|||
this.raiseError(`verifyReferencesAtPositionListContains failed - could not find the item: ${JSON.stringify(missingItem)} in the returned list: (${JSON.stringify(references)})`);
|
||||
}
|
||||
|
||||
public verifyReferencesCountIs(count: number, localFilesOnly: boolean = true) {
|
||||
public verifyReferencesCountIs(count: number, localFilesOnly = true) {
|
||||
this.taoInvalidReason = "verifyReferences NYI";
|
||||
|
||||
let references = this.getReferencesAtCaret();
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace ts.server {
|
|||
input: process.stdin,
|
||||
output: process.stdout,
|
||||
terminal: false,
|
||||
});
|
||||
});
|
||||
|
||||
class Logger implements ts.server.Logger {
|
||||
fd = -1;
|
||||
|
@ -58,7 +58,7 @@ namespace ts.server {
|
|||
isVerbose() {
|
||||
return this.loggingEnabled() && (this.level == "verbose");
|
||||
}
|
||||
|
||||
|
||||
|
||||
msg(s: string, type = "Err") {
|
||||
if (this.fd < 0) {
|
||||
|
@ -85,7 +85,7 @@ namespace ts.server {
|
|||
|
||||
interface WatchedFile {
|
||||
fileName: string;
|
||||
callback: (fileName: string) => void;
|
||||
callback: (fileName: string, removed: boolean) => void;
|
||||
mtime: Date;
|
||||
}
|
||||
|
||||
|
@ -121,11 +121,11 @@ namespace ts.server {
|
|||
|
||||
fs.stat(watchedFile.fileName,(err, stats) => {
|
||||
if (err) {
|
||||
watchedFile.callback(watchedFile.fileName);
|
||||
watchedFile.callback(watchedFile.fileName, /* removed */ false);
|
||||
}
|
||||
else if (watchedFile.mtime.getTime() !== stats.mtime.getTime()) {
|
||||
watchedFile.mtime = WatchedFileSet.getModifiedTime(watchedFile.fileName);
|
||||
watchedFile.callback(watchedFile.fileName);
|
||||
watchedFile.callback(watchedFile.fileName, watchedFile.mtime.getTime() === 0);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -153,7 +153,7 @@ namespace ts.server {
|
|||
}, this.interval);
|
||||
}
|
||||
|
||||
addFile(fileName: string, callback: (fileName: string) => void ): WatchedFile {
|
||||
addFile(fileName: string, callback: (fileName: string, removed: boolean) => void ): WatchedFile {
|
||||
var file: WatchedFile = {
|
||||
fileName,
|
||||
callback,
|
||||
|
@ -170,7 +170,7 @@ namespace ts.server {
|
|||
removeFile(file: WatchedFile) {
|
||||
this.watchedFiles = WatchedFileSet.copyListRemovingItem(file, this.watchedFiles);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class IOSession extends Session {
|
||||
constructor(host: ServerHost, logger: ts.server.Logger) {
|
||||
|
@ -243,11 +243,11 @@ namespace ts.server {
|
|||
// TODO: check that this location is writable
|
||||
|
||||
var logger = createLoggerFromEnv();
|
||||
|
||||
|
||||
// REVIEW: for now this implementation uses polling.
|
||||
// The advantage of polling is that it works reliably
|
||||
// on all os and with network mounted files.
|
||||
// For 90 referenced files, the average time to detect
|
||||
// For 90 referenced files, the average time to detect
|
||||
// changes is 2*msInterval (by default 5 seconds).
|
||||
// The overhead of this is .04 percent (1/2500) with
|
||||
// average pause of < 1 millisecond (and max
|
||||
|
@ -271,4 +271,4 @@ namespace ts.server {
|
|||
});
|
||||
// Start listening
|
||||
ioSession.listen();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3683,14 +3683,20 @@ namespace ts {
|
|||
|
||||
// Previous token may have been a keyword that was converted to an identifier.
|
||||
switch (contextToken.getText()) {
|
||||
case "abstract":
|
||||
case "async":
|
||||
case "class":
|
||||
case "interface":
|
||||
case "const":
|
||||
case "declare":
|
||||
case "enum":
|
||||
case "function":
|
||||
case "var":
|
||||
case "static":
|
||||
case "interface":
|
||||
case "let":
|
||||
case "const":
|
||||
case "private":
|
||||
case "protected":
|
||||
case "public":
|
||||
case "static":
|
||||
case "var":
|
||||
case "yield":
|
||||
return true;
|
||||
}
|
||||
|
|
24
tests/baselines/reference/asiAbstract.errors.txt
Normal file
24
tests/baselines/reference/asiAbstract.errors.txt
Normal file
|
@ -0,0 +1,24 @@
|
|||
tests/cases/compiler/asiAbstract.ts(1,1): error TS2304: Cannot find name 'abstract'.
|
||||
tests/cases/compiler/asiAbstract.ts(3,3): error TS1244: Abstract methods can only appear within an abstract class.
|
||||
|
||||
|
||||
==== tests/cases/compiler/asiAbstract.ts (2 errors) ====
|
||||
abstract
|
||||
~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'abstract'.
|
||||
class NonAbstractClass {
|
||||
abstract s();
|
||||
~~~~~~~~
|
||||
!!! error TS1244: Abstract methods can only appear within an abstract class.
|
||||
}
|
||||
|
||||
class C2 {
|
||||
abstract
|
||||
nonAbstractFunction() {
|
||||
}
|
||||
}
|
||||
|
||||
class C3 {
|
||||
abstract
|
||||
}
|
||||
|
36
tests/baselines/reference/asiAbstract.js
Normal file
36
tests/baselines/reference/asiAbstract.js
Normal file
|
@ -0,0 +1,36 @@
|
|||
//// [asiAbstract.ts]
|
||||
abstract
|
||||
class NonAbstractClass {
|
||||
abstract s();
|
||||
}
|
||||
|
||||
class C2 {
|
||||
abstract
|
||||
nonAbstractFunction() {
|
||||
}
|
||||
}
|
||||
|
||||
class C3 {
|
||||
abstract
|
||||
}
|
||||
|
||||
|
||||
//// [asiAbstract.js]
|
||||
abstract;
|
||||
var NonAbstractClass = (function () {
|
||||
function NonAbstractClass() {
|
||||
}
|
||||
return NonAbstractClass;
|
||||
})();
|
||||
var C2 = (function () {
|
||||
function C2() {
|
||||
}
|
||||
C2.prototype.nonAbstractFunction = function () {
|
||||
};
|
||||
return C2;
|
||||
})();
|
||||
var C3 = (function () {
|
||||
function C3() {
|
||||
}
|
||||
return C3;
|
||||
})();
|
|
@ -0,0 +1,52 @@
|
|||
tests/cases/compiler/asiPublicPrivateProtected.ts(1,1): error TS2304: Cannot find name 'public'.
|
||||
tests/cases/compiler/asiPublicPrivateProtected.ts(12,1): error TS2304: Cannot find name 'private'.
|
||||
tests/cases/compiler/asiPublicPrivateProtected.ts(23,1): error TS2304: Cannot find name 'protected'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/asiPublicPrivateProtected.ts (3 errors) ====
|
||||
public
|
||||
~~~~~~
|
||||
!!! error TS2304: Cannot find name 'public'.
|
||||
class NonPublicClass {
|
||||
public s() {
|
||||
}
|
||||
}
|
||||
|
||||
class NonPublicClass2 {
|
||||
public
|
||||
private nonPublicFunction() {
|
||||
}
|
||||
}
|
||||
private
|
||||
~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'private'.
|
||||
class NonPrivateClass {
|
||||
private s() {
|
||||
}
|
||||
}
|
||||
|
||||
class NonPrivateClass2 {
|
||||
private
|
||||
public nonPrivateFunction() {
|
||||
}
|
||||
}
|
||||
protected
|
||||
~~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'protected'.
|
||||
class NonProtectedClass {
|
||||
protected s() {
|
||||
}
|
||||
}
|
||||
|
||||
class NonProtectedClass2 {
|
||||
protected
|
||||
public nonProtectedFunction() {
|
||||
}
|
||||
}
|
||||
|
||||
class ClassWithThreeMembers {
|
||||
public
|
||||
private
|
||||
protected
|
||||
}
|
||||
|
93
tests/baselines/reference/asiPublicPrivateProtected.js
Normal file
93
tests/baselines/reference/asiPublicPrivateProtected.js
Normal file
|
@ -0,0 +1,93 @@
|
|||
//// [asiPublicPrivateProtected.ts]
|
||||
public
|
||||
class NonPublicClass {
|
||||
public s() {
|
||||
}
|
||||
}
|
||||
|
||||
class NonPublicClass2 {
|
||||
public
|
||||
private nonPublicFunction() {
|
||||
}
|
||||
}
|
||||
private
|
||||
class NonPrivateClass {
|
||||
private s() {
|
||||
}
|
||||
}
|
||||
|
||||
class NonPrivateClass2 {
|
||||
private
|
||||
public nonPrivateFunction() {
|
||||
}
|
||||
}
|
||||
protected
|
||||
class NonProtectedClass {
|
||||
protected s() {
|
||||
}
|
||||
}
|
||||
|
||||
class NonProtectedClass2 {
|
||||
protected
|
||||
public nonProtectedFunction() {
|
||||
}
|
||||
}
|
||||
|
||||
class ClassWithThreeMembers {
|
||||
public
|
||||
private
|
||||
protected
|
||||
}
|
||||
|
||||
|
||||
//// [asiPublicPrivateProtected.js]
|
||||
public;
|
||||
var NonPublicClass = (function () {
|
||||
function NonPublicClass() {
|
||||
}
|
||||
NonPublicClass.prototype.s = function () {
|
||||
};
|
||||
return NonPublicClass;
|
||||
})();
|
||||
var NonPublicClass2 = (function () {
|
||||
function NonPublicClass2() {
|
||||
}
|
||||
NonPublicClass2.prototype.nonPublicFunction = function () {
|
||||
};
|
||||
return NonPublicClass2;
|
||||
})();
|
||||
private;
|
||||
var NonPrivateClass = (function () {
|
||||
function NonPrivateClass() {
|
||||
}
|
||||
NonPrivateClass.prototype.s = function () {
|
||||
};
|
||||
return NonPrivateClass;
|
||||
})();
|
||||
var NonPrivateClass2 = (function () {
|
||||
function NonPrivateClass2() {
|
||||
}
|
||||
NonPrivateClass2.prototype.nonPrivateFunction = function () {
|
||||
};
|
||||
return NonPrivateClass2;
|
||||
})();
|
||||
protected;
|
||||
var NonProtectedClass = (function () {
|
||||
function NonProtectedClass() {
|
||||
}
|
||||
NonProtectedClass.prototype.s = function () {
|
||||
};
|
||||
return NonProtectedClass;
|
||||
})();
|
||||
var NonProtectedClass2 = (function () {
|
||||
function NonProtectedClass2() {
|
||||
}
|
||||
NonProtectedClass2.prototype.nonProtectedFunction = function () {
|
||||
};
|
||||
return NonProtectedClass2;
|
||||
})();
|
||||
var ClassWithThreeMembers = (function () {
|
||||
function ClassWithThreeMembers() {
|
||||
}
|
||||
return ClassWithThreeMembers;
|
||||
})();
|
|
@ -1,24 +0,0 @@
|
|||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractMultiLineDecl.ts(10,1): error TS2511: Cannot create an instance of the abstract class 'A'.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractMultiLineDecl.ts(11,1): error TS2511: Cannot create an instance of the abstract class 'B'.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractMultiLineDecl.ts(12,1): error TS2511: Cannot create an instance of the abstract class 'C'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractMultiLineDecl.ts (3 errors) ====
|
||||
abstract class A {}
|
||||
|
||||
abstract
|
||||
class B {}
|
||||
|
||||
abstract
|
||||
|
||||
class C {}
|
||||
|
||||
new A;
|
||||
~~~~~
|
||||
!!! error TS2511: Cannot create an instance of the abstract class 'A'.
|
||||
new B;
|
||||
~~~~~
|
||||
!!! error TS2511: Cannot create an instance of the abstract class 'B'.
|
||||
new C;
|
||||
~~~~~
|
||||
!!! error TS2511: Cannot create an instance of the abstract class 'C'.
|
|
@ -0,0 +1,24 @@
|
|||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractSingleLineDecl.ts(3,1): error TS2304: Cannot find name 'abstract'.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractSingleLineDecl.ts(6,1): error TS2304: Cannot find name 'abstract'.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractSingleLineDecl.ts(10,1): error TS2511: Cannot create an instance of the abstract class 'A'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractSingleLineDecl.ts (3 errors) ====
|
||||
abstract class A {}
|
||||
|
||||
abstract
|
||||
~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'abstract'.
|
||||
class B {}
|
||||
|
||||
abstract
|
||||
~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'abstract'.
|
||||
|
||||
class C {}
|
||||
|
||||
new A;
|
||||
~~~~~
|
||||
!!! error TS2511: Cannot create an instance of the abstract class 'A'.
|
||||
new B;
|
||||
new C;
|
|
@ -1,4 +1,4 @@
|
|||
//// [classAbstractMultiLineDecl.ts]
|
||||
//// [classAbstractSingleLineDecl.ts]
|
||||
abstract class A {}
|
||||
|
||||
abstract
|
||||
|
@ -12,17 +12,19 @@ new A;
|
|||
new B;
|
||||
new C;
|
||||
|
||||
//// [classAbstractMultiLineDecl.js]
|
||||
//// [classAbstractSingleLineDecl.js]
|
||||
var A = (function () {
|
||||
function A() {
|
||||
}
|
||||
return A;
|
||||
})();
|
||||
abstract;
|
||||
var B = (function () {
|
||||
function B() {
|
||||
}
|
||||
return B;
|
||||
})();
|
||||
abstract;
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
|
@ -3,12 +3,10 @@ var v = @decorate class C { static p = 1 };
|
|||
|
||||
//// [classExpressionWithDecorator1.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var v = ;
|
||||
var C = (function () {
|
||||
|
|
|
@ -11,12 +11,10 @@ import Decorated from 'decorated';
|
|||
|
||||
//// [decorated.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
function decorate(target) { }
|
||||
let Decorated = class {
|
||||
|
|
|
@ -17,12 +17,10 @@ class A {
|
|||
|
||||
//// [decoratorChecksFunctionBodies.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
// from #2971
|
||||
function func(s) {
|
||||
|
@ -32,13 +30,12 @@ var A = (function () {
|
|||
}
|
||||
A.prototype.m = function () {
|
||||
};
|
||||
Object.defineProperty(A.prototype, "m",
|
||||
__decorate([
|
||||
(function (x, p) {
|
||||
var a = 3;
|
||||
func(a);
|
||||
return x;
|
||||
})
|
||||
], A.prototype, "m", Object.getOwnPropertyDescriptor(A.prototype, "m")));
|
||||
__decorate([
|
||||
(function (x, p) {
|
||||
var a = 3;
|
||||
func(a);
|
||||
return x;
|
||||
})
|
||||
], A.prototype, "m", null);
|
||||
return A;
|
||||
})();
|
||||
|
|
|
@ -26,12 +26,10 @@ class Wat {
|
|||
exports.test = 'abc';
|
||||
//// [b.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var a_1 = require('./a');
|
||||
function filter(handler) {
|
||||
|
@ -45,9 +43,8 @@ var Wat = (function () {
|
|||
Wat.whatever = function () {
|
||||
// ...
|
||||
};
|
||||
Object.defineProperty(Wat, "whatever",
|
||||
__decorate([
|
||||
filter(function () { return a_1.test == 'abc'; })
|
||||
], Wat, "whatever", Object.getOwnPropertyDescriptor(Wat, "whatever")));
|
||||
__decorate([
|
||||
filter(function () { return a_1.test == 'abc'; })
|
||||
], Wat, "whatever", null);
|
||||
return Wat;
|
||||
})();
|
||||
|
|
|
@ -24,12 +24,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
exports.default = Service;
|
||||
//// [component.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
|
|
|
@ -20,12 +20,11 @@ var MyClass = (function () {
|
|||
}
|
||||
MyClass.prototype.doSomething = function () {
|
||||
};
|
||||
Object.defineProperty(MyClass.prototype, "doSomething",
|
||||
__decorate([
|
||||
decorator,
|
||||
__metadata('design:type', Function),
|
||||
__metadata('design:paramtypes', []),
|
||||
__metadata('design:returntype', void 0)
|
||||
], MyClass.prototype, "doSomething", Object.getOwnPropertyDescriptor(MyClass.prototype, "doSomething")));
|
||||
__decorate([
|
||||
decorator,
|
||||
__metadata('design:type', Function),
|
||||
__metadata('design:paramtypes', []),
|
||||
__metadata('design:returntype', void 0)
|
||||
], MyClass.prototype, "doSomething", null);
|
||||
return MyClass;
|
||||
})();
|
||||
|
|
|
@ -33,7 +33,7 @@ var B = (function () {
|
|||
__decorate([
|
||||
decorator,
|
||||
__metadata('design:type', Object)
|
||||
], B.prototype, "x");
|
||||
], B.prototype, "x", void 0);
|
||||
return B;
|
||||
})();
|
||||
exports.B = B;
|
||||
|
|
|
@ -33,7 +33,7 @@ var B = (function () {
|
|||
__decorate([
|
||||
decorator,
|
||||
__metadata('design:type', A)
|
||||
], B.prototype, "x");
|
||||
], B.prototype, "x", void 0);
|
||||
return B;
|
||||
})();
|
||||
exports.B = B;
|
||||
|
|
|
@ -7,12 +7,10 @@ class C {
|
|||
|
||||
//// [decoratorOnClass1.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var C = (function () {
|
||||
function C() {
|
||||
|
|
|
@ -7,12 +7,10 @@ export class C {
|
|||
|
||||
//// [decoratorOnClass2.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var C = (function () {
|
||||
function C() {
|
||||
|
|
|
@ -8,12 +8,10 @@ class C {
|
|||
|
||||
//// [decoratorOnClass3.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var C = (function () {
|
||||
function C() {
|
||||
|
|
|
@ -7,12 +7,10 @@ class C {
|
|||
|
||||
//// [decoratorOnClass4.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var C = (function () {
|
||||
function C() {
|
||||
|
|
|
@ -7,12 +7,10 @@ class C {
|
|||
|
||||
//// [decoratorOnClass5.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var C = (function () {
|
||||
function C() {
|
||||
|
|
|
@ -7,12 +7,10 @@ class C {
|
|||
|
||||
//// [decoratorOnClass8.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var C = (function () {
|
||||
function C() {
|
||||
|
|
|
@ -7,12 +7,10 @@ class C {
|
|||
|
||||
//// [decoratorOnClassAccessor1.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var C = (function () {
|
||||
function C() {
|
||||
|
@ -22,9 +20,8 @@ var C = (function () {
|
|||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(C.prototype, "accessor",
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor")));
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, "accessor", null);
|
||||
return C;
|
||||
})();
|
||||
|
|
|
@ -7,12 +7,10 @@ class C {
|
|||
|
||||
//// [decoratorOnClassAccessor2.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var C = (function () {
|
||||
function C() {
|
||||
|
@ -22,9 +20,8 @@ var C = (function () {
|
|||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(C.prototype, "accessor",
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor")));
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, "accessor", null);
|
||||
return C;
|
||||
})();
|
||||
|
|
|
@ -7,12 +7,10 @@ class C {
|
|||
|
||||
//// [decoratorOnClassAccessor3.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var C = (function () {
|
||||
function C() {
|
||||
|
@ -22,9 +20,8 @@ var C = (function () {
|
|||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(C.prototype, "accessor",
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor")));
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, "accessor", null);
|
||||
return C;
|
||||
})();
|
||||
|
|
|
@ -7,12 +7,10 @@ class C {
|
|||
|
||||
//// [decoratorOnClassAccessor4.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var C = (function () {
|
||||
function C() {
|
||||
|
@ -22,9 +20,8 @@ var C = (function () {
|
|||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(C.prototype, "accessor",
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor")));
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, "accessor", null);
|
||||
return C;
|
||||
})();
|
||||
|
|
|
@ -7,12 +7,10 @@ class C {
|
|||
|
||||
//// [decoratorOnClassAccessor5.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var C = (function () {
|
||||
function C() {
|
||||
|
@ -22,9 +20,8 @@ var C = (function () {
|
|||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(C.prototype, "accessor",
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor")));
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, "accessor", null);
|
||||
return C;
|
||||
})();
|
||||
|
|
|
@ -7,12 +7,10 @@ class C {
|
|||
|
||||
//// [decoratorOnClassAccessor6.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var C = (function () {
|
||||
function C() {
|
||||
|
@ -22,9 +20,8 @@ var C = (function () {
|
|||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(C.prototype, "accessor",
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor")));
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, "accessor", null);
|
||||
return C;
|
||||
})();
|
||||
|
|
|
@ -7,12 +7,10 @@ class C {
|
|||
|
||||
//// [decoratorOnClassConstructorParameter1.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
return function (target, key) { decorator(target, key, paramIndex); }
|
||||
|
|
|
@ -7,12 +7,10 @@ class C {
|
|||
|
||||
//// [decoratorOnClassConstructorParameter4.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
return function (target, key) { decorator(target, key, paramIndex); }
|
||||
|
|
|
@ -7,20 +7,17 @@ class C {
|
|||
|
||||
//// [decoratorOnClassMethod1.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype.method = function () { };
|
||||
Object.defineProperty(C.prototype, "method",
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method")));
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, "method", null);
|
||||
return C;
|
||||
})();
|
||||
|
|
|
@ -7,20 +7,17 @@ class C {
|
|||
|
||||
//// [decoratorOnClassMethod10.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype.method = function () { };
|
||||
Object.defineProperty(C.prototype, "method",
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method")));
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, "method", null);
|
||||
return C;
|
||||
})();
|
||||
|
|
|
@ -10,12 +10,10 @@ module M {
|
|||
|
||||
//// [decoratorOnClassMethod11.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var M;
|
||||
(function (M) {
|
||||
|
@ -24,10 +22,9 @@ var M;
|
|||
}
|
||||
C.prototype.decorator = function (target, key) { };
|
||||
C.prototype.method = function () { };
|
||||
Object.defineProperty(C.prototype, "method",
|
||||
__decorate([
|
||||
this.decorator
|
||||
], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method")));
|
||||
__decorate([
|
||||
this.decorator
|
||||
], C.prototype, "method", null);
|
||||
return C;
|
||||
})();
|
||||
})(M || (M = {}));
|
||||
|
|
|
@ -16,12 +16,10 @@ var __extends = (this && this.__extends) || function (d, b) {
|
|||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var M;
|
||||
(function (M) {
|
||||
|
@ -37,10 +35,9 @@ var M;
|
|||
_super.apply(this, arguments);
|
||||
}
|
||||
C.prototype.method = function () { };
|
||||
Object.defineProperty(C.prototype, "method",
|
||||
__decorate([
|
||||
_super.decorator
|
||||
], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method")));
|
||||
__decorate([
|
||||
_super.decorator
|
||||
], C.prototype, "method", null);
|
||||
return C;
|
||||
})(S);
|
||||
})(M || (M = {}));
|
||||
|
|
|
@ -8,23 +8,19 @@ class C {
|
|||
|
||||
//// [decoratorOnClassMethod13.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
class C {
|
||||
[_a = "1"]() { }
|
||||
[_b = "b"]() { }
|
||||
}
|
||||
Object.defineProperty(C.prototype, _a,
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, _a, Object.getOwnPropertyDescriptor(C.prototype, _a)));
|
||||
Object.defineProperty(C.prototype, _b,
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, _b, Object.getOwnPropertyDescriptor(C.prototype, _b)));
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, _a, null);
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, _b, null);
|
||||
var _a, _b;
|
||||
|
|
|
@ -7,20 +7,17 @@ class C {
|
|||
|
||||
//// [decoratorOnClassMethod2.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype.method = function () { };
|
||||
Object.defineProperty(C.prototype, "method",
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method")));
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, "method", null);
|
||||
return C;
|
||||
})();
|
||||
|
|
|
@ -7,20 +7,17 @@ class C {
|
|||
|
||||
//// [decoratorOnClassMethod3.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype.method = function () { };
|
||||
Object.defineProperty(C.prototype, "method",
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method")));
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, "method", null);
|
||||
return C;
|
||||
})();
|
||||
|
|
|
@ -7,18 +7,15 @@ class C {
|
|||
|
||||
//// [decoratorOnClassMethod4.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
class C {
|
||||
[_a = "method"]() { }
|
||||
}
|
||||
Object.defineProperty(C.prototype, _a,
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, _a, Object.getOwnPropertyDescriptor(C.prototype, _a)));
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, _a, null);
|
||||
var _a;
|
||||
|
|
|
@ -7,18 +7,15 @@ class C {
|
|||
|
||||
//// [decoratorOnClassMethod5.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
class C {
|
||||
[_a = "method"]() { }
|
||||
}
|
||||
Object.defineProperty(C.prototype, _a,
|
||||
__decorate([
|
||||
dec()
|
||||
], C.prototype, _a, Object.getOwnPropertyDescriptor(C.prototype, _a)));
|
||||
__decorate([
|
||||
dec()
|
||||
], C.prototype, _a, null);
|
||||
var _a;
|
||||
|
|
|
@ -7,18 +7,15 @@ class C {
|
|||
|
||||
//// [decoratorOnClassMethod6.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
class C {
|
||||
[_a = "method"]() { }
|
||||
}
|
||||
Object.defineProperty(C.prototype, _a,
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, _a, Object.getOwnPropertyDescriptor(C.prototype, _a)));
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, _a, null);
|
||||
var _a;
|
||||
|
|
|
@ -7,18 +7,15 @@ class C {
|
|||
|
||||
//// [decoratorOnClassMethod7.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
class C {
|
||||
[_a = "method"]() { }
|
||||
}
|
||||
Object.defineProperty(C.prototype, _a,
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, _a, Object.getOwnPropertyDescriptor(C.prototype, _a)));
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, _a, null);
|
||||
var _a;
|
||||
|
|
|
@ -7,20 +7,17 @@ class C {
|
|||
|
||||
//// [decoratorOnClassMethod8.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype.method = function () { };
|
||||
Object.defineProperty(C.prototype, "method",
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method")));
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, "method", null);
|
||||
return C;
|
||||
})();
|
||||
|
|
|
@ -7,12 +7,10 @@ class C {
|
|||
|
||||
//// [decoratorOnClassMethodParameter1.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
return function (target, key) { decorator(target, key, paramIndex); }
|
||||
|
@ -21,9 +19,8 @@ var C = (function () {
|
|||
function C() {
|
||||
}
|
||||
C.prototype.method = function (p) { };
|
||||
Object.defineProperty(C.prototype, "method",
|
||||
__decorate([
|
||||
__param(0, dec)
|
||||
], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method")));
|
||||
__decorate([
|
||||
__param(0, dec)
|
||||
], C.prototype, "method", null);
|
||||
return C;
|
||||
})();
|
||||
|
|
|
@ -7,18 +7,16 @@ class C {
|
|||
|
||||
//// [decoratorOnClassProperty1.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, "prop");
|
||||
], C.prototype, "prop", void 0);
|
||||
return C;
|
||||
})();
|
||||
|
|
|
@ -7,18 +7,16 @@ class C {
|
|||
|
||||
//// [decoratorOnClassProperty10.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
__decorate([
|
||||
dec()
|
||||
], C.prototype, "prop");
|
||||
], C.prototype, "prop", void 0);
|
||||
return C;
|
||||
})();
|
||||
|
|
|
@ -7,18 +7,16 @@ class C {
|
|||
|
||||
//// [decoratorOnClassProperty11.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, "prop");
|
||||
], C.prototype, "prop", void 0);
|
||||
return C;
|
||||
})();
|
||||
|
|
|
@ -7,18 +7,16 @@ class C {
|
|||
|
||||
//// [decoratorOnClassProperty2.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, "prop");
|
||||
], C.prototype, "prop", void 0);
|
||||
return C;
|
||||
})();
|
||||
|
|
|
@ -7,18 +7,16 @@ class C {
|
|||
|
||||
//// [decoratorOnClassProperty3.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, "prop");
|
||||
], C.prototype, "prop", void 0);
|
||||
return C;
|
||||
})();
|
||||
|
|
|
@ -7,18 +7,16 @@ class C {
|
|||
|
||||
//// [decoratorOnClassProperty6.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, "prop");
|
||||
], C.prototype, "prop", void 0);
|
||||
return C;
|
||||
})();
|
||||
|
|
|
@ -7,18 +7,16 @@ class C {
|
|||
|
||||
//// [decoratorOnClassProperty7.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, "prop");
|
||||
], C.prototype, "prop", void 0);
|
||||
return C;
|
||||
})();
|
||||
|
|
|
@ -8,6 +8,7 @@ var x = foo1;
|
|||
|
||||
class y extends x {}
|
||||
>y : Symbol(y, Decl(foo2.ts, 1, 13))
|
||||
>x : Symbol(x, Decl(foo2.ts, 1, 3))
|
||||
|
||||
=== tests/cases/conformance/classes/classExpressions/foo1.ts ===
|
||||
class x{}
|
||||
|
|
|
@ -9,4 +9,5 @@ var x = A;
|
|||
|
||||
class C extends x { } // error, could not find symbol xs
|
||||
>C : Symbol(C, Decl(extendNonClassSymbol1.ts, 1, 10))
|
||||
>x : Symbol(x, Decl(extendNonClassSymbol1.ts, 1, 3))
|
||||
|
||||
|
|
|
@ -11,12 +11,10 @@ function* g() {
|
|||
|
||||
//// [generatorTypeCheck39.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
function decorator(x) {
|
||||
return y => { };
|
||||
|
|
|
@ -8,20 +8,17 @@ function* g() {
|
|||
|
||||
//// [generatorTypeCheck59.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
function* g() {
|
||||
class C {
|
||||
m() { }
|
||||
}
|
||||
Object.defineProperty(C.prototype, "m",
|
||||
__decorate([
|
||||
(yield "")
|
||||
], C.prototype, "m", Object.getOwnPropertyDescriptor(C.prototype, "m")));
|
||||
__decorate([
|
||||
(yield "")
|
||||
], C.prototype, "m", null);
|
||||
;
|
||||
}
|
||||
|
|
|
@ -6,12 +6,10 @@ function * g() {
|
|||
|
||||
//// [generatorTypeCheck61.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
function* g() {
|
||||
let C = class {
|
||||
|
|
|
@ -145,6 +145,7 @@ var x =
|
|||
|
||||
<Component { ... x } y
|
||||
>Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11))
|
||||
>x : Symbol(x, Decl(jsxReactTestSuite.tsx, 10, 11), Decl(jsxReactTestSuite.tsx, 35, 3))
|
||||
>y : Symbol(unknown)
|
||||
|
||||
={2 } z />;
|
||||
|
@ -167,25 +168,31 @@ var x =
|
|||
|
||||
<Component {...x} />;
|
||||
>Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11))
|
||||
>x : Symbol(x, Decl(jsxReactTestSuite.tsx, 10, 11), Decl(jsxReactTestSuite.tsx, 35, 3))
|
||||
|
||||
<Component { ...x } y={2} />;
|
||||
>Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11))
|
||||
>x : Symbol(x, Decl(jsxReactTestSuite.tsx, 10, 11), Decl(jsxReactTestSuite.tsx, 35, 3))
|
||||
>y : Symbol(unknown)
|
||||
|
||||
<Component { ... x } y={2} z />;
|
||||
>Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11))
|
||||
>x : Symbol(x, Decl(jsxReactTestSuite.tsx, 10, 11), Decl(jsxReactTestSuite.tsx, 35, 3))
|
||||
>y : Symbol(unknown)
|
||||
>z : Symbol(unknown)
|
||||
|
||||
<Component x={1} {...y} />;
|
||||
>Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11))
|
||||
>x : Symbol(unknown)
|
||||
>y : Symbol(y, Decl(jsxReactTestSuite.tsx, 9, 11))
|
||||
|
||||
|
||||
<Component x={1} y="2" {...z} {...z}><Child /></Component>;
|
||||
>Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11))
|
||||
>x : Symbol(unknown)
|
||||
>y : Symbol(unknown)
|
||||
>z : Symbol(z, Decl(jsxReactTestSuite.tsx, 11, 11))
|
||||
>z : Symbol(z, Decl(jsxReactTestSuite.tsx, 11, 11))
|
||||
>Child : Symbol(Child, Decl(jsxReactTestSuite.tsx, 5, 11))
|
||||
>Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11))
|
||||
|
||||
|
|
|
@ -24,20 +24,17 @@ class C {
|
|||
//// [a.js]
|
||||
//// [b.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype.method = function () { };
|
||||
Object.defineProperty(C.prototype, "method",
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method")));
|
||||
__decorate([
|
||||
dec
|
||||
], C.prototype, "method", null);
|
||||
return C;
|
||||
})();
|
||||
|
|
15
tests/baselines/reference/modulePrologueAMD.js
Normal file
15
tests/baselines/reference/modulePrologueAMD.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
//// [modulePrologueAMD.ts]
|
||||
"use strict";
|
||||
|
||||
export class Foo {}
|
||||
|
||||
//// [modulePrologueAMD.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
var Foo = (function () {
|
||||
function Foo() {
|
||||
}
|
||||
return Foo;
|
||||
})();
|
||||
exports.Foo = Foo;
|
||||
});
|
6
tests/baselines/reference/modulePrologueAMD.symbols
Normal file
6
tests/baselines/reference/modulePrologueAMD.symbols
Normal file
|
@ -0,0 +1,6 @@
|
|||
=== tests/cases/compiler/modulePrologueAMD.ts ===
|
||||
"use strict";
|
||||
|
||||
export class Foo {}
|
||||
>Foo : Symbol(Foo, Decl(modulePrologueAMD.ts, 0, 13))
|
||||
|
7
tests/baselines/reference/modulePrologueAMD.types
Normal file
7
tests/baselines/reference/modulePrologueAMD.types
Normal file
|
@ -0,0 +1,7 @@
|
|||
=== tests/cases/compiler/modulePrologueAMD.ts ===
|
||||
"use strict";
|
||||
>"use strict" : string
|
||||
|
||||
export class Foo {}
|
||||
>Foo : Foo
|
||||
|
13
tests/baselines/reference/modulePrologueCommonjs.js
Normal file
13
tests/baselines/reference/modulePrologueCommonjs.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
//// [modulePrologueCommonjs.ts]
|
||||
"use strict";
|
||||
|
||||
export class Foo {}
|
||||
|
||||
//// [modulePrologueCommonjs.js]
|
||||
"use strict";
|
||||
var Foo = (function () {
|
||||
function Foo() {
|
||||
}
|
||||
return Foo;
|
||||
})();
|
||||
exports.Foo = Foo;
|
6
tests/baselines/reference/modulePrologueCommonjs.symbols
Normal file
6
tests/baselines/reference/modulePrologueCommonjs.symbols
Normal file
|
@ -0,0 +1,6 @@
|
|||
=== tests/cases/compiler/modulePrologueCommonjs.ts ===
|
||||
"use strict";
|
||||
|
||||
export class Foo {}
|
||||
>Foo : Symbol(Foo, Decl(modulePrologueCommonjs.ts, 0, 13))
|
||||
|
7
tests/baselines/reference/modulePrologueCommonjs.types
Normal file
7
tests/baselines/reference/modulePrologueCommonjs.types
Normal file
|
@ -0,0 +1,7 @@
|
|||
=== tests/cases/compiler/modulePrologueCommonjs.ts ===
|
||||
"use strict";
|
||||
>"use strict" : string
|
||||
|
||||
export class Foo {}
|
||||
>Foo : Foo
|
||||
|
9
tests/baselines/reference/modulePrologueES6.js
Normal file
9
tests/baselines/reference/modulePrologueES6.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
//// [modulePrologueES6.ts]
|
||||
"use strict";
|
||||
|
||||
export class Foo {}
|
||||
|
||||
//// [modulePrologueES6.js]
|
||||
"use strict";
|
||||
export class Foo {
|
||||
}
|
6
tests/baselines/reference/modulePrologueES6.symbols
Normal file
6
tests/baselines/reference/modulePrologueES6.symbols
Normal file
|
@ -0,0 +1,6 @@
|
|||
=== tests/cases/compiler/modulePrologueES6.ts ===
|
||||
"use strict";
|
||||
|
||||
export class Foo {}
|
||||
>Foo : Symbol(Foo, Decl(modulePrologueES6.ts, 0, 13))
|
||||
|
7
tests/baselines/reference/modulePrologueES6.types
Normal file
7
tests/baselines/reference/modulePrologueES6.types
Normal file
|
@ -0,0 +1,7 @@
|
|||
=== tests/cases/compiler/modulePrologueES6.ts ===
|
||||
"use strict";
|
||||
>"use strict" : string
|
||||
|
||||
export class Foo {}
|
||||
>Foo : Foo
|
||||
|
21
tests/baselines/reference/modulePrologueSystem.js
Normal file
21
tests/baselines/reference/modulePrologueSystem.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
//// [modulePrologueSystem.ts]
|
||||
"use strict";
|
||||
|
||||
export class Foo {}
|
||||
|
||||
//// [modulePrologueSystem.js]
|
||||
System.register([], function(exports_1) {
|
||||
"use strict";
|
||||
var Foo;
|
||||
return {
|
||||
setters:[],
|
||||
execute: function() {
|
||||
Foo = (function () {
|
||||
function Foo() {
|
||||
}
|
||||
return Foo;
|
||||
})();
|
||||
exports_1("Foo", Foo);
|
||||
}
|
||||
}
|
||||
});
|
6
tests/baselines/reference/modulePrologueSystem.symbols
Normal file
6
tests/baselines/reference/modulePrologueSystem.symbols
Normal file
|
@ -0,0 +1,6 @@
|
|||
=== tests/cases/compiler/modulePrologueSystem.ts ===
|
||||
"use strict";
|
||||
|
||||
export class Foo {}
|
||||
>Foo : Symbol(Foo, Decl(modulePrologueSystem.ts, 0, 13))
|
||||
|
7
tests/baselines/reference/modulePrologueSystem.types
Normal file
7
tests/baselines/reference/modulePrologueSystem.types
Normal file
|
@ -0,0 +1,7 @@
|
|||
=== tests/cases/compiler/modulePrologueSystem.ts ===
|
||||
"use strict";
|
||||
>"use strict" : string
|
||||
|
||||
export class Foo {}
|
||||
>Foo : Foo
|
||||
|
22
tests/baselines/reference/modulePrologueUmd.js
Normal file
22
tests/baselines/reference/modulePrologueUmd.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
//// [modulePrologueUmd.ts]
|
||||
"use strict";
|
||||
|
||||
export class Foo {}
|
||||
|
||||
//// [modulePrologueUmd.js]
|
||||
(function (factory) {
|
||||
if (typeof module === 'object' && typeof module.exports === 'object') {
|
||||
var v = factory(require, exports); if (v !== undefined) module.exports = v;
|
||||
}
|
||||
else if (typeof define === 'function' && define.amd) {
|
||||
define(["require", "exports"], factory);
|
||||
}
|
||||
})(function (require, exports) {
|
||||
"use strict";
|
||||
var Foo = (function () {
|
||||
function Foo() {
|
||||
}
|
||||
return Foo;
|
||||
})();
|
||||
exports.Foo = Foo;
|
||||
});
|
6
tests/baselines/reference/modulePrologueUmd.symbols
Normal file
6
tests/baselines/reference/modulePrologueUmd.symbols
Normal file
|
@ -0,0 +1,6 @@
|
|||
=== tests/cases/compiler/modulePrologueUmd.ts ===
|
||||
"use strict";
|
||||
|
||||
export class Foo {}
|
||||
>Foo : Symbol(Foo, Decl(modulePrologueUmd.ts, 0, 13))
|
||||
|
7
tests/baselines/reference/modulePrologueUmd.types
Normal file
7
tests/baselines/reference/modulePrologueUmd.types
Normal file
|
@ -0,0 +1,7 @@
|
|||
=== tests/cases/compiler/modulePrologueUmd.ts ===
|
||||
"use strict";
|
||||
>"use strict" : string
|
||||
|
||||
export class Foo {}
|
||||
>Foo : Foo
|
||||
|
29
tests/baselines/reference/recursiveGenericUnionType1.js
Normal file
29
tests/baselines/reference/recursiveGenericUnionType1.js
Normal file
|
@ -0,0 +1,29 @@
|
|||
//// [recursiveGenericUnionType1.ts]
|
||||
declare module Test1 {
|
||||
export type Container<T> = T | {
|
||||
[i: string]: Container<T>;
|
||||
};
|
||||
export type IStringContainer = Container<string>;
|
||||
}
|
||||
|
||||
declare module Test2 {
|
||||
export type Container<T> = T | {
|
||||
[i: string]: Container<T>;
|
||||
};
|
||||
export type IStringContainer = Container<string>;
|
||||
}
|
||||
|
||||
var x: Test1.Container<number>;
|
||||
|
||||
var s1: Test1.IStringContainer;
|
||||
var s2: Test2.IStringContainer;
|
||||
s1 = s2;
|
||||
s2 = s1;
|
||||
|
||||
|
||||
//// [recursiveGenericUnionType1.js]
|
||||
var x;
|
||||
var s1;
|
||||
var s2;
|
||||
s1 = s2;
|
||||
s2 = s1;
|
62
tests/baselines/reference/recursiveGenericUnionType1.symbols
Normal file
62
tests/baselines/reference/recursiveGenericUnionType1.symbols
Normal file
|
@ -0,0 +1,62 @@
|
|||
=== tests/cases/compiler/recursiveGenericUnionType1.ts ===
|
||||
declare module Test1 {
|
||||
>Test1 : Symbol(Test1, Decl(recursiveGenericUnionType1.ts, 0, 0))
|
||||
|
||||
export type Container<T> = T | {
|
||||
>Container : Symbol(Container, Decl(recursiveGenericUnionType1.ts, 0, 22))
|
||||
>T : Symbol(T, Decl(recursiveGenericUnionType1.ts, 1, 26))
|
||||
>T : Symbol(T, Decl(recursiveGenericUnionType1.ts, 1, 26))
|
||||
|
||||
[i: string]: Container<T>;
|
||||
>i : Symbol(i, Decl(recursiveGenericUnionType1.ts, 2, 9))
|
||||
>Container : Symbol(Container, Decl(recursiveGenericUnionType1.ts, 0, 22))
|
||||
>T : Symbol(T, Decl(recursiveGenericUnionType1.ts, 1, 26))
|
||||
|
||||
};
|
||||
export type IStringContainer = Container<string>;
|
||||
>IStringContainer : Symbol(IStringContainer, Decl(recursiveGenericUnionType1.ts, 3, 6))
|
||||
>Container : Symbol(Container, Decl(recursiveGenericUnionType1.ts, 0, 22))
|
||||
}
|
||||
|
||||
declare module Test2 {
|
||||
>Test2 : Symbol(Test2, Decl(recursiveGenericUnionType1.ts, 5, 1))
|
||||
|
||||
export type Container<T> = T | {
|
||||
>Container : Symbol(Container, Decl(recursiveGenericUnionType1.ts, 7, 22))
|
||||
>T : Symbol(T, Decl(recursiveGenericUnionType1.ts, 8, 26))
|
||||
>T : Symbol(T, Decl(recursiveGenericUnionType1.ts, 8, 26))
|
||||
|
||||
[i: string]: Container<T>;
|
||||
>i : Symbol(i, Decl(recursiveGenericUnionType1.ts, 9, 9))
|
||||
>Container : Symbol(Container, Decl(recursiveGenericUnionType1.ts, 7, 22))
|
||||
>T : Symbol(T, Decl(recursiveGenericUnionType1.ts, 8, 26))
|
||||
|
||||
};
|
||||
export type IStringContainer = Container<string>;
|
||||
>IStringContainer : Symbol(IStringContainer, Decl(recursiveGenericUnionType1.ts, 10, 6))
|
||||
>Container : Symbol(Container, Decl(recursiveGenericUnionType1.ts, 7, 22))
|
||||
}
|
||||
|
||||
var x: Test1.Container<number>;
|
||||
>x : Symbol(x, Decl(recursiveGenericUnionType1.ts, 14, 3))
|
||||
>Test1 : Symbol(Test1, Decl(recursiveGenericUnionType1.ts, 0, 0))
|
||||
>Container : Symbol(Test1.Container, Decl(recursiveGenericUnionType1.ts, 0, 22))
|
||||
|
||||
var s1: Test1.IStringContainer;
|
||||
>s1 : Symbol(s1, Decl(recursiveGenericUnionType1.ts, 16, 3))
|
||||
>Test1 : Symbol(Test1, Decl(recursiveGenericUnionType1.ts, 0, 0))
|
||||
>IStringContainer : Symbol(Test1.IStringContainer, Decl(recursiveGenericUnionType1.ts, 3, 6))
|
||||
|
||||
var s2: Test2.IStringContainer;
|
||||
>s2 : Symbol(s2, Decl(recursiveGenericUnionType1.ts, 17, 3))
|
||||
>Test2 : Symbol(Test2, Decl(recursiveGenericUnionType1.ts, 5, 1))
|
||||
>IStringContainer : Symbol(Test2.IStringContainer, Decl(recursiveGenericUnionType1.ts, 10, 6))
|
||||
|
||||
s1 = s2;
|
||||
>s1 : Symbol(s1, Decl(recursiveGenericUnionType1.ts, 16, 3))
|
||||
>s2 : Symbol(s2, Decl(recursiveGenericUnionType1.ts, 17, 3))
|
||||
|
||||
s2 = s1;
|
||||
>s2 : Symbol(s2, Decl(recursiveGenericUnionType1.ts, 17, 3))
|
||||
>s1 : Symbol(s1, Decl(recursiveGenericUnionType1.ts, 16, 3))
|
||||
|
64
tests/baselines/reference/recursiveGenericUnionType1.types
Normal file
64
tests/baselines/reference/recursiveGenericUnionType1.types
Normal file
|
@ -0,0 +1,64 @@
|
|||
=== tests/cases/compiler/recursiveGenericUnionType1.ts ===
|
||||
declare module Test1 {
|
||||
>Test1 : any
|
||||
|
||||
export type Container<T> = T | {
|
||||
>Container : T | { [i: string]: T | any; }
|
||||
>T : T
|
||||
>T : T
|
||||
|
||||
[i: string]: Container<T>;
|
||||
>i : string
|
||||
>Container : T | { [i: string]: T | any; }
|
||||
>T : T
|
||||
|
||||
};
|
||||
export type IStringContainer = Container<string>;
|
||||
>IStringContainer : string | { [i: string]: string | any; }
|
||||
>Container : T | { [i: string]: T | any; }
|
||||
}
|
||||
|
||||
declare module Test2 {
|
||||
>Test2 : any
|
||||
|
||||
export type Container<T> = T | {
|
||||
>Container : T | { [i: string]: T | any; }
|
||||
>T : T
|
||||
>T : T
|
||||
|
||||
[i: string]: Container<T>;
|
||||
>i : string
|
||||
>Container : T | { [i: string]: T | any; }
|
||||
>T : T
|
||||
|
||||
};
|
||||
export type IStringContainer = Container<string>;
|
||||
>IStringContainer : string | { [i: string]: string | any; }
|
||||
>Container : T | { [i: string]: T | any; }
|
||||
}
|
||||
|
||||
var x: Test1.Container<number>;
|
||||
>x : number | { [i: string]: number | any; }
|
||||
>Test1 : any
|
||||
>Container : T | { [i: string]: T | any; }
|
||||
|
||||
var s1: Test1.IStringContainer;
|
||||
>s1 : string | { [i: string]: string | any; }
|
||||
>Test1 : any
|
||||
>IStringContainer : string | { [i: string]: string | any; }
|
||||
|
||||
var s2: Test2.IStringContainer;
|
||||
>s2 : string | { [i: string]: string | any; }
|
||||
>Test2 : any
|
||||
>IStringContainer : string | { [i: string]: string | any; }
|
||||
|
||||
s1 = s2;
|
||||
>s1 = s2 : string | { [i: string]: string | any; }
|
||||
>s1 : string | { [i: string]: string | any; }
|
||||
>s2 : string | { [i: string]: string | any; }
|
||||
|
||||
s2 = s1;
|
||||
>s2 = s1 : string | { [i: string]: string | any; }
|
||||
>s2 : string | { [i: string]: string | any; }
|
||||
>s1 : string | { [i: string]: string | any; }
|
||||
|
29
tests/baselines/reference/recursiveGenericUnionType2.js
Normal file
29
tests/baselines/reference/recursiveGenericUnionType2.js
Normal file
|
@ -0,0 +1,29 @@
|
|||
//// [recursiveGenericUnionType2.ts]
|
||||
declare module Test1 {
|
||||
export type Container<T> = T | {
|
||||
[i: string]: Container<T>[];
|
||||
};
|
||||
export type IStringContainer = Container<string>;
|
||||
}
|
||||
|
||||
declare module Test2 {
|
||||
export type Container<T> = T | {
|
||||
[i: string]: Container<T>[];
|
||||
};
|
||||
export type IStringContainer = Container<string>;
|
||||
}
|
||||
|
||||
var x: Test1.Container<number>;
|
||||
|
||||
var s1: Test1.IStringContainer;
|
||||
var s2: Test2.IStringContainer;
|
||||
s1 = s2;
|
||||
s2 = s1;
|
||||
|
||||
|
||||
//// [recursiveGenericUnionType2.js]
|
||||
var x;
|
||||
var s1;
|
||||
var s2;
|
||||
s1 = s2;
|
||||
s2 = s1;
|
62
tests/baselines/reference/recursiveGenericUnionType2.symbols
Normal file
62
tests/baselines/reference/recursiveGenericUnionType2.symbols
Normal file
|
@ -0,0 +1,62 @@
|
|||
=== tests/cases/compiler/recursiveGenericUnionType2.ts ===
|
||||
declare module Test1 {
|
||||
>Test1 : Symbol(Test1, Decl(recursiveGenericUnionType2.ts, 0, 0))
|
||||
|
||||
export type Container<T> = T | {
|
||||
>Container : Symbol(Container, Decl(recursiveGenericUnionType2.ts, 0, 22))
|
||||
>T : Symbol(T, Decl(recursiveGenericUnionType2.ts, 1, 26))
|
||||
>T : Symbol(T, Decl(recursiveGenericUnionType2.ts, 1, 26))
|
||||
|
||||
[i: string]: Container<T>[];
|
||||
>i : Symbol(i, Decl(recursiveGenericUnionType2.ts, 2, 9))
|
||||
>Container : Symbol(Container, Decl(recursiveGenericUnionType2.ts, 0, 22))
|
||||
>T : Symbol(T, Decl(recursiveGenericUnionType2.ts, 1, 26))
|
||||
|
||||
};
|
||||
export type IStringContainer = Container<string>;
|
||||
>IStringContainer : Symbol(IStringContainer, Decl(recursiveGenericUnionType2.ts, 3, 6))
|
||||
>Container : Symbol(Container, Decl(recursiveGenericUnionType2.ts, 0, 22))
|
||||
}
|
||||
|
||||
declare module Test2 {
|
||||
>Test2 : Symbol(Test2, Decl(recursiveGenericUnionType2.ts, 5, 1))
|
||||
|
||||
export type Container<T> = T | {
|
||||
>Container : Symbol(Container, Decl(recursiveGenericUnionType2.ts, 7, 22))
|
||||
>T : Symbol(T, Decl(recursiveGenericUnionType2.ts, 8, 26))
|
||||
>T : Symbol(T, Decl(recursiveGenericUnionType2.ts, 8, 26))
|
||||
|
||||
[i: string]: Container<T>[];
|
||||
>i : Symbol(i, Decl(recursiveGenericUnionType2.ts, 9, 9))
|
||||
>Container : Symbol(Container, Decl(recursiveGenericUnionType2.ts, 7, 22))
|
||||
>T : Symbol(T, Decl(recursiveGenericUnionType2.ts, 8, 26))
|
||||
|
||||
};
|
||||
export type IStringContainer = Container<string>;
|
||||
>IStringContainer : Symbol(IStringContainer, Decl(recursiveGenericUnionType2.ts, 10, 6))
|
||||
>Container : Symbol(Container, Decl(recursiveGenericUnionType2.ts, 7, 22))
|
||||
}
|
||||
|
||||
var x: Test1.Container<number>;
|
||||
>x : Symbol(x, Decl(recursiveGenericUnionType2.ts, 14, 3))
|
||||
>Test1 : Symbol(Test1, Decl(recursiveGenericUnionType2.ts, 0, 0))
|
||||
>Container : Symbol(Test1.Container, Decl(recursiveGenericUnionType2.ts, 0, 22))
|
||||
|
||||
var s1: Test1.IStringContainer;
|
||||
>s1 : Symbol(s1, Decl(recursiveGenericUnionType2.ts, 16, 3))
|
||||
>Test1 : Symbol(Test1, Decl(recursiveGenericUnionType2.ts, 0, 0))
|
||||
>IStringContainer : Symbol(Test1.IStringContainer, Decl(recursiveGenericUnionType2.ts, 3, 6))
|
||||
|
||||
var s2: Test2.IStringContainer;
|
||||
>s2 : Symbol(s2, Decl(recursiveGenericUnionType2.ts, 17, 3))
|
||||
>Test2 : Symbol(Test2, Decl(recursiveGenericUnionType2.ts, 5, 1))
|
||||
>IStringContainer : Symbol(Test2.IStringContainer, Decl(recursiveGenericUnionType2.ts, 10, 6))
|
||||
|
||||
s1 = s2;
|
||||
>s1 : Symbol(s1, Decl(recursiveGenericUnionType2.ts, 16, 3))
|
||||
>s2 : Symbol(s2, Decl(recursiveGenericUnionType2.ts, 17, 3))
|
||||
|
||||
s2 = s1;
|
||||
>s2 : Symbol(s2, Decl(recursiveGenericUnionType2.ts, 17, 3))
|
||||
>s1 : Symbol(s1, Decl(recursiveGenericUnionType2.ts, 16, 3))
|
||||
|
64
tests/baselines/reference/recursiveGenericUnionType2.types
Normal file
64
tests/baselines/reference/recursiveGenericUnionType2.types
Normal file
|
@ -0,0 +1,64 @@
|
|||
=== tests/cases/compiler/recursiveGenericUnionType2.ts ===
|
||||
declare module Test1 {
|
||||
>Test1 : any
|
||||
|
||||
export type Container<T> = T | {
|
||||
>Container : T | { [i: string]: (T | any)[]; }
|
||||
>T : T
|
||||
>T : T
|
||||
|
||||
[i: string]: Container<T>[];
|
||||
>i : string
|
||||
>Container : T | { [i: string]: (T | any)[]; }
|
||||
>T : T
|
||||
|
||||
};
|
||||
export type IStringContainer = Container<string>;
|
||||
>IStringContainer : string | { [i: string]: (string | any)[]; }
|
||||
>Container : T | { [i: string]: (T | any)[]; }
|
||||
}
|
||||
|
||||
declare module Test2 {
|
||||
>Test2 : any
|
||||
|
||||
export type Container<T> = T | {
|
||||
>Container : T | { [i: string]: (T | any)[]; }
|
||||
>T : T
|
||||
>T : T
|
||||
|
||||
[i: string]: Container<T>[];
|
||||
>i : string
|
||||
>Container : T | { [i: string]: (T | any)[]; }
|
||||
>T : T
|
||||
|
||||
};
|
||||
export type IStringContainer = Container<string>;
|
||||
>IStringContainer : string | { [i: string]: (string | any)[]; }
|
||||
>Container : T | { [i: string]: (T | any)[]; }
|
||||
}
|
||||
|
||||
var x: Test1.Container<number>;
|
||||
>x : number | { [i: string]: (number | any)[]; }
|
||||
>Test1 : any
|
||||
>Container : T | { [i: string]: (T | any)[]; }
|
||||
|
||||
var s1: Test1.IStringContainer;
|
||||
>s1 : string | { [i: string]: (string | any)[]; }
|
||||
>Test1 : any
|
||||
>IStringContainer : string | { [i: string]: (string | any)[]; }
|
||||
|
||||
var s2: Test2.IStringContainer;
|
||||
>s2 : string | { [i: string]: (string | any)[]; }
|
||||
>Test2 : any
|
||||
>IStringContainer : string | { [i: string]: (string | any)[]; }
|
||||
|
||||
s1 = s2;
|
||||
>s1 = s2 : string | { [i: string]: (string | any)[]; }
|
||||
>s1 : string | { [i: string]: (string | any)[]; }
|
||||
>s2 : string | { [i: string]: (string | any)[]; }
|
||||
|
||||
s2 = s1;
|
||||
>s2 = s1 : string | { [i: string]: (string | any)[]; }
|
||||
>s2 : string | { [i: string]: (string | any)[]; }
|
||||
>s1 : string | { [i: string]: (string | any)[]; }
|
||||
|
|
@ -56,12 +56,10 @@ class Greeter {
|
|||
|
||||
//// [sourceMapValidationDecorators.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
return function (target, key) { decorator(target, key, paramIndex); }
|
||||
|
@ -91,31 +89,28 @@ var Greeter = (function () {
|
|||
configurable: true
|
||||
});
|
||||
Greeter.x1 = 10;
|
||||
Object.defineProperty(Greeter.prototype, "greet",
|
||||
__decorate([
|
||||
PropertyDecorator1,
|
||||
PropertyDecorator2(40)
|
||||
], Greeter.prototype, "greet", Object.getOwnPropertyDescriptor(Greeter.prototype, "greet")));
|
||||
__decorate([
|
||||
PropertyDecorator1,
|
||||
PropertyDecorator2(40)
|
||||
], Greeter.prototype, "greet", null);
|
||||
__decorate([
|
||||
PropertyDecorator1,
|
||||
PropertyDecorator2(50)
|
||||
], Greeter.prototype, "x");
|
||||
Object.defineProperty(Greeter.prototype, "fn",
|
||||
__decorate([
|
||||
__param(0, ParameterDecorator1),
|
||||
__param(0, ParameterDecorator2(70))
|
||||
], Greeter.prototype, "fn", Object.getOwnPropertyDescriptor(Greeter.prototype, "fn")));
|
||||
Object.defineProperty(Greeter.prototype, "greetings",
|
||||
__decorate([
|
||||
PropertyDecorator1,
|
||||
PropertyDecorator2(80),
|
||||
__param(0, ParameterDecorator1),
|
||||
__param(0, ParameterDecorator2(90))
|
||||
], Greeter.prototype, "greetings", Object.getOwnPropertyDescriptor(Greeter.prototype, "greetings")));
|
||||
], Greeter.prototype, "x", void 0);
|
||||
__decorate([
|
||||
__param(0, ParameterDecorator1),
|
||||
__param(0, ParameterDecorator2(70))
|
||||
], Greeter.prototype, "fn", null);
|
||||
__decorate([
|
||||
PropertyDecorator1,
|
||||
PropertyDecorator2(80),
|
||||
__param(0, ParameterDecorator1),
|
||||
__param(0, ParameterDecorator2(90))
|
||||
], Greeter.prototype, "greetings", null);
|
||||
__decorate([
|
||||
PropertyDecorator1,
|
||||
PropertyDecorator2(60)
|
||||
], Greeter, "x1");
|
||||
], Greeter, "x1", void 0);
|
||||
Greeter = __decorate([
|
||||
ClassDecorator1,
|
||||
ClassDecorator2(10),
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
//// [sourceMapValidationDecorators.js.map]
|
||||
{"version":3,"file":"sourceMapValidationDecorators.js","sourceRoot":"","sources":["sourceMapValidationDecorators.ts"],"names":["Greeter","Greeter.constructor","Greeter.greet","Greeter.fn","Greeter.greetings"],"mappings":";;;;;;;;;;;AAOA;IAGIA,iBAGSA,QAAgBA;QAEvBC,WAEcA;aAFdA,WAEcA,CAFdA,sBAEcA,CAFdA,IAEcA;YAFdA,0BAEcA;;QAJPA,aAAQA,GAARA,QAAQA,CAAQA;IAKzBA,CAACA;IAIDD,uBAAKA,GAFLA;QAGIE,MAAMA,CAACA,MAAMA,GAAGA,IAAIA,CAACA,QAAQA,GAAGA,OAAOA,CAACA;IAC5CA,CAACA;IAUOF,oBAAEA,GAAVA,UAGEA,CAASA;QACPG,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA;IACzBA,CAACA;IAEDH,sBAEIA,8BAASA;aAFbA;YAGII,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA;QACzBA,CAACA;aAEDJ,UAGEA,SAAiBA;YACfI,IAAIA,CAACA,QAAQA,GAAGA,SAASA,CAACA;QAC9BA,CAACA;;;OAPAJ;IAbcA,UAAEA,GAAWA,EAAEA,CAACA;IAZ/BA,sBAEAA,0BAAKA;;YAFJA,kBAAkBA;YAClBA,kBAAkBA,CAACA,EAAEA,CAACA;WACvBA,0BAAKA,kCAALA,0BAAKA,IAEJA;IAEDA;QAACA,kBAAkBA;QAClBA,kBAAkBA,CAACA,EAAEA,CAACA;OACfA,sBAACA,EAASA;IAMlBA,sBAAQA,uBAAEA;;YACRA,WAACA,mBAAmBA,CAAAA;YACpBA,WAACA,mBAAmBA,CAACA,EAAEA,CAACA,CAAAA;WAFlBA,uBAAEA,kCAAFA,uBAAEA,IAKTA;IAEDA,sBAEIA,8BAASA;;YAFZA,kBAAkBA;YAClBA,kBAAkBA,CAACA,EAAEA,CAACA;YAMrBA,WAACA,mBAAmBA,CAAAA;YACpBA,WAACA,mBAAmBA,CAACA,EAAEA,CAACA,CAAAA;WANtBA,8BAASA,kCAATA,8BAASA,IAEZA;IAfDA;QAACA,kBAAkBA;QAClBA,kBAAkBA,CAACA,EAAEA,CAACA;OACRA,aAAEA,EAAcA;IAzBnCA;QAACA,eAAeA;QACfA,eAAeA,CAACA,EAAEA,CAACA;QAGdA,WAACA,mBAAmBA,CAAAA;QACpBA,WAACA,mBAAmBA,CAACA,EAAEA,CAACA,CAAAA;QAGxBA,WAACA,mBAAmBA,CAAAA;QACpBA,WAACA,mBAAmBA,CAACA,EAAEA,CAACA,CAAAA;gBAqC7BA;IAADA,cAACA;AAADA,CAACA,AA9CD,IA8CC"}
|
||||
{"version":3,"file":"sourceMapValidationDecorators.js","sourceRoot":"","sources":["sourceMapValidationDecorators.ts"],"names":["Greeter","Greeter.constructor","Greeter.greet","Greeter.fn","Greeter.greetings"],"mappings":";;;;;;;;;AAOA;IAGIA,iBAGSA,QAAgBA;QAEvBC,WAEcA;aAFdA,WAEcA,CAFdA,sBAEcA,CAFdA,IAEcA;YAFdA,0BAEcA;;QAJPA,aAAQA,GAARA,QAAQA,CAAQA;IAKzBA,CAACA;IAIDD,uBAAKA,GAFLA;QAGIE,MAAMA,CAACA,MAAMA,GAAGA,IAAIA,CAACA,QAAQA,GAAGA,OAAOA,CAACA;IAC5CA,CAACA;IAUOF,oBAAEA,GAAVA,UAGEA,CAASA;QACPG,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA;IACzBA,CAACA;IAEDH,sBAEIA,8BAASA;aAFbA;YAGII,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA;QACzBA,CAACA;aAEDJ,UAGEA,SAAiBA;YACfI,IAAIA,CAACA,QAAQA,GAAGA,SAASA,CAACA;QAC9BA,CAACA;;;OAPAJ;IAbcA,UAAEA,GAAWA,EAAEA,CAACA;IAZ/BA;QAACA,kBAAkBA;QAClBA,kBAAkBA,CAACA,EAAEA,CAACA;OACvBA,0BAAKA,QAEJA;IAEDA;QAACA,kBAAkBA;QAClBA,kBAAkBA,CAACA,EAAEA,CAACA;OACfA,sBAACA,UAASA;IAMlBA;QACEA,WAACA,mBAAmBA,CAAAA;QACpBA,WAACA,mBAAmBA,CAACA,EAAEA,CAACA,CAAAA;OAFlBA,uBAAEA,QAKTA;IAEDA;QAACA,kBAAkBA;QAClBA,kBAAkBA,CAACA,EAAEA,CAACA;QAMrBA,WAACA,mBAAmBA,CAAAA;QACpBA,WAACA,mBAAmBA,CAACA,EAAEA,CAACA,CAAAA;OANtBA,8BAASA,QAEZA;IAfDA;QAACA,kBAAkBA;QAClBA,kBAAkBA,CAACA,EAAEA,CAACA;OACRA,aAAEA,UAAcA;IAzBnCA;QAACA,eAAeA;QACfA,eAAeA,CAACA,EAAEA,CAACA;QAGdA,WAACA,mBAAmBA,CAAAA;QACpBA,WAACA,mBAAmBA,CAACA,EAAEA,CAACA,CAAAA;QAGxBA,WAACA,mBAAmBA,CAAAA;QACpBA,WAACA,mBAAmBA,CAACA,EAAEA,CAACA,CAAAA;gBAqC7BA;IAADA,cAACA;AAADA,CAACA,AA9CD,IA8CC"}
|
File diff suppressed because it is too large
Load diff
|
@ -20,4 +20,5 @@ var x: any;
|
|||
// Should be OK
|
||||
<test1 {...x} />
|
||||
>test1 : Symbol(JSX.IntrinsicElements.test1, Decl(tsxAttributeResolution8.tsx, 2, 30))
|
||||
>x : Symbol(x, Decl(tsxAttributeResolution8.tsx, 7, 3))
|
||||
|
||||
|
|
|
@ -21,12 +21,14 @@ var p1, p2, p3;
|
|||
var spreads1 = <div {...p1}>{p2}</div>;
|
||||
>spreads1 : Symbol(spreads1, Decl(tsxEmit2.tsx, 8, 3))
|
||||
>div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit2.tsx, 1, 22))
|
||||
>p1 : Symbol(p1, Decl(tsxEmit2.tsx, 7, 3))
|
||||
>p2 : Symbol(p2, Decl(tsxEmit2.tsx, 7, 7))
|
||||
>div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit2.tsx, 1, 22))
|
||||
|
||||
var spreads2 = <div {...p1}>{p2}</div>;
|
||||
>spreads2 : Symbol(spreads2, Decl(tsxEmit2.tsx, 9, 3))
|
||||
>div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit2.tsx, 1, 22))
|
||||
>p1 : Symbol(p1, Decl(tsxEmit2.tsx, 7, 3))
|
||||
>p2 : Symbol(p2, Decl(tsxEmit2.tsx, 7, 7))
|
||||
>div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit2.tsx, 1, 22))
|
||||
|
||||
|
@ -35,12 +37,14 @@ var spreads3 = <div x={p3} {...p1}>{p2}</div>;
|
|||
>div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit2.tsx, 1, 22))
|
||||
>x : Symbol(unknown)
|
||||
>p3 : Symbol(p3, Decl(tsxEmit2.tsx, 7, 11))
|
||||
>p1 : Symbol(p1, Decl(tsxEmit2.tsx, 7, 3))
|
||||
>p2 : Symbol(p2, Decl(tsxEmit2.tsx, 7, 7))
|
||||
>div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit2.tsx, 1, 22))
|
||||
|
||||
var spreads4 = <div {...p1} x={p3} >{p2}</div>;
|
||||
>spreads4 : Symbol(spreads4, Decl(tsxEmit2.tsx, 11, 3))
|
||||
>div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit2.tsx, 1, 22))
|
||||
>p1 : Symbol(p1, Decl(tsxEmit2.tsx, 7, 3))
|
||||
>x : Symbol(unknown)
|
||||
>p3 : Symbol(p3, Decl(tsxEmit2.tsx, 7, 11))
|
||||
>p2 : Symbol(p2, Decl(tsxEmit2.tsx, 7, 7))
|
||||
|
@ -51,6 +55,7 @@ var spreads5 = <div x={p2} {...p1} y={p3}>{p2}</div>;
|
|||
>div : Symbol(JSX.IntrinsicElements, Decl(tsxEmit2.tsx, 1, 22))
|
||||
>x : Symbol(unknown)
|
||||
>p2 : Symbol(p2, Decl(tsxEmit2.tsx, 7, 7))
|
||||
>p1 : Symbol(p1, Decl(tsxEmit2.tsx, 7, 3))
|
||||
>y : Symbol(unknown)
|
||||
>p3 : Symbol(p3, Decl(tsxEmit2.tsx, 7, 11))
|
||||
>p2 : Symbol(p2, Decl(tsxEmit2.tsx, 7, 7))
|
||||
|
|
|
@ -26,6 +26,7 @@ declare var Foo, React;
|
|||
// Should see mod_1['default'] in emit here
|
||||
<Foo {...Main}></Foo>;
|
||||
>Foo : Symbol(Foo, Decl(app.tsx, 1, 11))
|
||||
>Main : Symbol(Main, Decl(app.tsx, 0, 6))
|
||||
>Foo : Symbol(Foo, Decl(app.tsx, 1, 11))
|
||||
|
||||
|
||||
|
|
32
tests/baselines/reference/tsxPreserveEmit1.js
Normal file
32
tests/baselines/reference/tsxPreserveEmit1.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
//// [tests/cases/conformance/jsx/tsxPreserveEmit1.tsx] ////
|
||||
|
||||
//// [react.d.ts]
|
||||
|
||||
declare module 'react' {
|
||||
var x: any;
|
||||
export = x;
|
||||
}
|
||||
|
||||
declare module ReactRouter {
|
||||
var Route: any;
|
||||
interface Thing { }
|
||||
}
|
||||
declare module 'react-router' {
|
||||
export = ReactRouter;
|
||||
}
|
||||
|
||||
//// [test.tsx]
|
||||
// Should emit 'react-router' in the AMD dependency list
|
||||
import React = require('react');
|
||||
import ReactRouter = require('react-router');
|
||||
|
||||
import Route = ReactRouter.Route;
|
||||
|
||||
var routes = <Route />;
|
||||
|
||||
|
||||
//// [test.jsx]
|
||||
define(["require", "exports", 'react-router'], function (require, exports, ReactRouter) {
|
||||
var Route = ReactRouter.Route;
|
||||
var routes = <Route />;
|
||||
});
|
41
tests/baselines/reference/tsxPreserveEmit1.symbols
Normal file
41
tests/baselines/reference/tsxPreserveEmit1.symbols
Normal file
|
@ -0,0 +1,41 @@
|
|||
=== tests/cases/conformance/jsx/test.tsx ===
|
||||
// Should emit 'react-router' in the AMD dependency list
|
||||
import React = require('react');
|
||||
>React : Symbol(React, Decl(test.tsx, 0, 0))
|
||||
|
||||
import ReactRouter = require('react-router');
|
||||
>ReactRouter : Symbol(ReactRouter, Decl(test.tsx, 1, 32))
|
||||
|
||||
import Route = ReactRouter.Route;
|
||||
>Route : Symbol(Route, Decl(test.tsx, 2, 45))
|
||||
>ReactRouter : Symbol(ReactRouter, Decl(react.d.ts, 4, 1))
|
||||
>Route : Symbol(ReactRouter.Route, Decl(react.d.ts, 7, 4))
|
||||
|
||||
var routes = <Route />;
|
||||
>routes : Symbol(routes, Decl(test.tsx, 6, 3))
|
||||
>Route : Symbol(Route, Decl(test.tsx, 2, 45))
|
||||
|
||||
=== tests/cases/conformance/jsx/react.d.ts ===
|
||||
|
||||
declare module 'react' {
|
||||
var x: any;
|
||||
>x : Symbol(x, Decl(react.d.ts, 2, 4))
|
||||
|
||||
export = x;
|
||||
>x : Symbol(x, Decl(react.d.ts, 2, 4))
|
||||
}
|
||||
|
||||
declare module ReactRouter {
|
||||
>ReactRouter : Symbol(ReactRouter, Decl(react.d.ts, 4, 1))
|
||||
|
||||
var Route: any;
|
||||
>Route : Symbol(Route, Decl(react.d.ts, 7, 4))
|
||||
|
||||
interface Thing { }
|
||||
>Thing : Symbol(Thing, Decl(react.d.ts, 7, 16))
|
||||
}
|
||||
declare module 'react-router' {
|
||||
export = ReactRouter;
|
||||
>ReactRouter : Symbol(ReactRouter, Decl(react.d.ts, 4, 1))
|
||||
}
|
||||
|
42
tests/baselines/reference/tsxPreserveEmit1.types
Normal file
42
tests/baselines/reference/tsxPreserveEmit1.types
Normal file
|
@ -0,0 +1,42 @@
|
|||
=== tests/cases/conformance/jsx/test.tsx ===
|
||||
// Should emit 'react-router' in the AMD dependency list
|
||||
import React = require('react');
|
||||
>React : any
|
||||
|
||||
import ReactRouter = require('react-router');
|
||||
>ReactRouter : typeof ReactRouter
|
||||
|
||||
import Route = ReactRouter.Route;
|
||||
>Route : any
|
||||
>ReactRouter : typeof ReactRouter
|
||||
>Route : any
|
||||
|
||||
var routes = <Route />;
|
||||
>routes : any
|
||||
><Route /> : any
|
||||
>Route : any
|
||||
|
||||
=== tests/cases/conformance/jsx/react.d.ts ===
|
||||
|
||||
declare module 'react' {
|
||||
var x: any;
|
||||
>x : any
|
||||
|
||||
export = x;
|
||||
>x : any
|
||||
}
|
||||
|
||||
declare module ReactRouter {
|
||||
>ReactRouter : typeof ReactRouter
|
||||
|
||||
var Route: any;
|
||||
>Route : any
|
||||
|
||||
interface Thing { }
|
||||
>Thing : Thing
|
||||
}
|
||||
declare module 'react-router' {
|
||||
export = ReactRouter;
|
||||
>ReactRouter : typeof ReactRouter
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue