From c0267ec8e1ad2f4c07d50375a01cf869ff59dbf0 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Thu, 27 Aug 2015 14:22:42 -0700 Subject: [PATCH] Adding test --- ...singPropertiesOfClassExpression.errors.txt | 12 +++++++++ .../missingPropertiesOfClassExpression.js | 26 +++++++++++++++++++ .../missingPropertiesOfClassExpression.ts | 5 ++++ 3 files changed, 43 insertions(+) create mode 100644 tests/baselines/reference/missingPropertiesOfClassExpression.errors.txt create mode 100644 tests/baselines/reference/missingPropertiesOfClassExpression.js create mode 100644 tests/cases/compiler/missingPropertiesOfClassExpression.ts diff --git a/tests/baselines/reference/missingPropertiesOfClassExpression.errors.txt b/tests/baselines/reference/missingPropertiesOfClassExpression.errors.txt new file mode 100644 index 00000000000..b7331a68271 --- /dev/null +++ b/tests/baselines/reference/missingPropertiesOfClassExpression.errors.txt @@ -0,0 +1,12 @@ +tests/cases/compiler/missingPropertiesOfClassExpression.ts(1,52): error TS2339: Property 'y' does not exist on type '(Anonymous class)'. + + +==== tests/cases/compiler/missingPropertiesOfClassExpression.ts (1 errors) ==== + class George extends class { reset() { return this.y; } } { + ~ +!!! error TS2339: Property 'y' does not exist on type '(Anonymous class)'. + constructor() { + super(); + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/missingPropertiesOfClassExpression.js b/tests/baselines/reference/missingPropertiesOfClassExpression.js new file mode 100644 index 00000000000..f427da20f0c --- /dev/null +++ b/tests/baselines/reference/missingPropertiesOfClassExpression.js @@ -0,0 +1,26 @@ +//// [missingPropertiesOfClassExpression.ts] +class George extends class { reset() { return this.y; } } { + constructor() { + super(); + } +} + + +//// [missingPropertiesOfClassExpression.js] +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var George = (function (_super) { + __extends(George, _super); + function George() { + _super.call(this); + } + return George; +})((function () { + function class_1() { + } + class_1.prototype.reset = function () { return this.y; }; + return class_1; +})()); diff --git a/tests/cases/compiler/missingPropertiesOfClassExpression.ts b/tests/cases/compiler/missingPropertiesOfClassExpression.ts new file mode 100644 index 00000000000..a1d91355365 --- /dev/null +++ b/tests/cases/compiler/missingPropertiesOfClassExpression.ts @@ -0,0 +1,5 @@ +class George extends class { reset() { return this.y; } } { + constructor() { + super(); + } +}