mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
tests(39373): add addition tests (#39631)
This commit is contained in:
parent
f19c610d91
commit
92f41c81fb
@ -10,6 +10,6 @@
|
||||
==== /node_modules/@types/node/index.d.ts (0 errors) ====
|
||||
declare const require: any;
|
||||
|
||||
==== /a.ts (0 errors) ====
|
||||
==== /a.js (0 errors) ====
|
||||
export class Foo {}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
//// [index.d.ts]
|
||||
declare const require: any;
|
||||
|
||||
//// [a.ts]
|
||||
//// [a.js]
|
||||
export class Foo {}
|
||||
|
||||
//// [b.ts]
|
||||
|
||||
@ -0,0 +1,11 @@
|
||||
tests/cases/compiler/declarationEmitExpressionInExtends7.ts(1,30): error TS2304: Cannot find name 'SomeUndefinedFunction'.
|
||||
tests/cases/compiler/declarationEmitExpressionInExtends7.ts(1,30): error TS4021: 'extends' clause of exported class has or is using private name 'SomeUndefinedFunction'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/declarationEmitExpressionInExtends7.ts (2 errors) ====
|
||||
export default class extends SomeUndefinedFunction {}
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'SomeUndefinedFunction'.
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS4021: 'extends' clause of exported class has or is using private name 'SomeUndefinedFunction'.
|
||||
|
||||
@ -0,0 +1,28 @@
|
||||
//// [declarationEmitExpressionInExtends7.ts]
|
||||
export default class extends SomeUndefinedFunction {}
|
||||
|
||||
|
||||
//// [declarationEmitExpressionInExtends7.js]
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
exports.__esModule = true;
|
||||
var default_1 = /** @class */ (function (_super) {
|
||||
__extends(default_1, _super);
|
||||
function default_1() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
return default_1;
|
||||
}(SomeUndefinedFunction));
|
||||
exports["default"] = default_1;
|
||||
@ -0,0 +1,4 @@
|
||||
=== tests/cases/compiler/declarationEmitExpressionInExtends7.ts ===
|
||||
export default class extends SomeUndefinedFunction {}
|
||||
No type information for this code.
|
||||
No type information for this code.
|
||||
@ -0,0 +1,4 @@
|
||||
=== tests/cases/compiler/declarationEmitExpressionInExtends7.ts ===
|
||||
export default class extends SomeUndefinedFunction {}
|
||||
>SomeUndefinedFunction : any
|
||||
|
||||
@ -1,12 +1,13 @@
|
||||
// @module: commonjs
|
||||
// @declaration: true
|
||||
// @allowJs: true
|
||||
// @types: node
|
||||
// @currentDirectory: /
|
||||
|
||||
// @Filename: /node_modules/@types/node/index.d.ts
|
||||
declare const require: any;
|
||||
|
||||
// @Filename: /a.ts
|
||||
// @Filename: /a.js
|
||||
export class Foo {}
|
||||
|
||||
// @Filename: /b.ts
|
||||
|
||||
@ -0,0 +1,2 @@
|
||||
// @declaration: true
|
||||
export default class extends SomeUndefinedFunction {}
|
||||
Loading…
x
Reference in New Issue
Block a user