Skip to content

tests(39373): add addition tests #39631

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//// [index.d.ts]
declare const require: any;

//// [a.ts]
//// [a.js]
export class Foo {}

//// [b.ts]
Expand Down
Original file line number Diff line number Diff line change
@@ -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'.

28 changes: 28 additions & 0 deletions tests/baselines/reference/declarationEmitExpressionInExtends7.js
Original file line number Diff line number Diff line change
@@ -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;
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
=== tests/cases/compiler/declarationEmitExpressionInExtends7.ts ===
export default class extends SomeUndefinedFunction {}
>SomeUndefinedFunction : any

3 changes: 2 additions & 1 deletion tests/cases/compiler/declarationEmitExpressionInExtends6.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions tests/cases/compiler/declarationEmitExpressionInExtends7.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// @declaration: true
export default class extends SomeUndefinedFunction {}