mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
always set NodeCheckFlags when checking super expression
This commit is contained in:
@@ -139,14 +139,14 @@ var __extends = (this && this.__extends) || function (d, b) {
|
||||
//super property access in instance member accessor(get and set) of class with no base type
|
||||
var NoBase = (function () {
|
||||
function NoBase() {
|
||||
this.m = _super.prototype;
|
||||
this.n = _super.hasOwnProperty.call(this, '');
|
||||
var a = _super.prototype;
|
||||
var b = _super.hasOwnProperty.call(this, '');
|
||||
this.m = _super.prototype.prototype;
|
||||
this.n = _super.prototype.hasOwnProperty.call(this, '');
|
||||
var a = _super.prototype.prototype;
|
||||
var b = _super.prototype.hasOwnProperty.call(this, '');
|
||||
}
|
||||
NoBase.prototype.fn = function () {
|
||||
var a = _super.prototype;
|
||||
var b = _super.hasOwnProperty.call(this, '');
|
||||
var a = _super.prototype.prototype;
|
||||
var b = _super.prototype.hasOwnProperty.call(this, '');
|
||||
};
|
||||
//super static property access in static member function of class with no base type
|
||||
//super static property access in static member accessor(get and set) of class with no base type
|
||||
|
||||
@@ -18,7 +18,7 @@ var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype.foo = function () {
|
||||
_super.foo.call(this);
|
||||
_super.prototype.foo.call(this);
|
||||
};
|
||||
return C;
|
||||
})();
|
||||
@@ -30,7 +30,7 @@ var M1;
|
||||
function C() {
|
||||
}
|
||||
C.prototype.foo = function () {
|
||||
_super.foo.call(this);
|
||||
_super.prototype.foo.call(this);
|
||||
};
|
||||
return C;
|
||||
})();
|
||||
|
||||
@@ -10,7 +10,7 @@ var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype.M = function () {
|
||||
_super..call(this, 0);
|
||||
_super.prototype..call(this, 0);
|
||||
};
|
||||
return C;
|
||||
})();
|
||||
|
||||
@@ -18,7 +18,7 @@ var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype.foo = function () {
|
||||
_super.foo = 1;
|
||||
_super.prototype.foo = 1;
|
||||
};
|
||||
return C;
|
||||
})();
|
||||
@@ -30,7 +30,7 @@ var M1;
|
||||
function C() {
|
||||
}
|
||||
C.prototype.foo = function () {
|
||||
_super.foo = 1;
|
||||
_super.prototype.foo = 1;
|
||||
};
|
||||
return C;
|
||||
})();
|
||||
|
||||
@@ -79,7 +79,7 @@ var Base2 = (function () {
|
||||
function Base2() {
|
||||
}
|
||||
Base2.prototype.foo = function () {
|
||||
_super.foo.call(this);
|
||||
_super.prototype.foo.call(this);
|
||||
};
|
||||
return Base2;
|
||||
})();
|
||||
|
||||
@@ -165,7 +165,7 @@ var Base4;
|
||||
function Sub4E() {
|
||||
}
|
||||
Sub4E.prototype.x = function () {
|
||||
return _super.x.call(this);
|
||||
return _super.prototype.x.call(this);
|
||||
};
|
||||
return Sub4E;
|
||||
})();
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
tests/cases/compiler/superCallWithMissingBaseClass.ts(1,19): error TS2304: Cannot find name 'Bar'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/superCallWithMissingBaseClass.ts (1 errors) ====
|
||||
class Foo extends Bar {
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'Bar'.
|
||||
m1() {
|
||||
return super.m1();
|
||||
}
|
||||
|
||||
static m2() {
|
||||
return super.m2();
|
||||
}
|
||||
}
|
||||
30
tests/baselines/reference/superCallWithMissingBaseClass.js
Normal file
30
tests/baselines/reference/superCallWithMissingBaseClass.js
Normal file
@@ -0,0 +1,30 @@
|
||||
//// [superCallWithMissingBaseClass.ts]
|
||||
class Foo extends Bar {
|
||||
m1() {
|
||||
return super.m1();
|
||||
}
|
||||
|
||||
static m2() {
|
||||
return super.m2();
|
||||
}
|
||||
}
|
||||
|
||||
//// [superCallWithMissingBaseClass.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 Foo = (function (_super) {
|
||||
__extends(Foo, _super);
|
||||
function Foo() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
Foo.prototype.m1 = function () {
|
||||
return _super.prototype.m1.call(this);
|
||||
};
|
||||
Foo.m2 = function () {
|
||||
return _super.m2.call(this);
|
||||
};
|
||||
return Foo;
|
||||
})(Bar);
|
||||
9
tests/cases/compiler/superCallWithMissingBaseClass.ts
Normal file
9
tests/cases/compiler/superCallWithMissingBaseClass.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
class Foo extends Bar {
|
||||
m1() {
|
||||
return super.m1();
|
||||
}
|
||||
|
||||
static m2() {
|
||||
return super.m2();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user