1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
//// [es6ClassTest8.ts]
function f1(x:any) {return x;}
class C {
constructor() {
var bar:any = (function() {
return bar; // 'bar' should be resolvable
});
var b = f1(f1(bar));
}
}
class Vector {
static norm(v:Vector):Vector {return null;}
static minus(v1:Vector, v2:Vector):Vector {return null;}
static times(v1:Vector, v2:Vector):Vector {return null;}
static cross(v1:Vector, v2:Vector):Vector {return null;}
constructor(public x: number,
public y: number,
public z: number) {
}
static dot(v1:Vector, v2:Vector):Vector {return null;}
}
class Camera {
public forward: Vector;
public right: Vector;
public up: Vector;
constructor(public pos: Vector, lookAt: Vector) {
var down = new Vector(0.0, -1.0, 0.0);
this.forward = Vector.norm(Vector.minus(lookAt,this.pos));
this.right = Vector.times(down, Vector.norm(Vector.cross(this.forward, down)));
this.up = Vector.times(down, Vector.norm(Vector.cross(this.forward, this.right)));
}
}
//// [es6ClassTest8.js]
function f1(x) { return x; }
var C = /** @class */ (function () {
function C() {
var bar = (function () {
return bar; // 'bar' should be resolvable
});
var b = f1(f1(bar));
}
return C;
}());
var Vector = /** @class */ (function () {
function Vector(x, y, z) {
this.x = x;
this.y = y;
this.z = z;
}
Vector.norm = function (v) { return null; };
Vector.minus = function (v1, v2) { return null; };
Vector.times = function (v1, v2) { return null; };
Vector.cross = function (v1, v2) { return null; };
Vector.dot = function (v1, v2) { return null; };
return Vector;
}());
var Camera = /** @class */ (function () {
function Camera(pos, lookAt) {
this.pos = pos;
var down = new Vector(0.0, -1.0, 0.0);
this.forward = Vector.norm(Vector.minus(lookAt, this.pos));
this.right = Vector.times(down, Vector.norm(Vector.cross(this.forward, down)));
this.up = Vector.times(down, Vector.norm(Vector.cross(this.forward, this.right)));
}
return Camera;
}());
|