2014-07-13 01:04:16 +02:00
|
|
|
//// [assignToExistingClass.ts]
|
|
|
|
module Test {
|
|
|
|
class Mocked {
|
|
|
|
myProp: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
class Tester {
|
|
|
|
willThrowError() {
|
|
|
|
Mocked = Mocked || function () { // => Error: Invalid left-hand side of assignment expression.
|
|
|
|
return { myProp: "test" };
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//// [assignToExistingClass.js]
|
|
|
|
var Test;
|
|
|
|
(function (Test) {
|
|
|
|
var Mocked = (function () {
|
|
|
|
function Mocked() {
|
|
|
|
}
|
|
|
|
return Mocked;
|
|
|
|
})();
|
|
|
|
var Tester = (function () {
|
|
|
|
function Tester() {
|
|
|
|
}
|
|
|
|
Tester.prototype.willThrowError = function () {
|
|
|
|
Mocked = Mocked || function () {
|
2015-03-09 02:23:23 +01:00
|
|
|
return {
|
|
|
|
myProp: "test"
|
|
|
|
};
|
2014-07-13 01:04:16 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
return Tester;
|
|
|
|
})();
|
|
|
|
})(Test || (Test = {}));
|