Skip to content

Commit a2b5cc1

Browse files
committed
Various updates from review process
1 parent 9987112 commit a2b5cc1

32 files changed

+25404
-25210
lines changed

Chapter 12/arrow.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
var Pages;
2-
(function (Pages) {
3-
var LoginPage = (function () {
4-
function LoginPage(container) {
5-
var _this = this;
6-
container.on("click", ".login-link", function (item) {
7-
_this.login();
8-
});
9-
container.on("click", ".login-link", function (item) {
10-
this.login();
11-
});
12-
}
13-
LoginPage.prototype.login = function () {
14-
console.log("logged in");
15-
};
16-
return LoginPage;
17-
})();
18-
Pages.LoginPage = LoginPage;
19-
})(Pages || (Pages = {}));
1+
var Pages;
2+
(function (Pages) {
3+
var LoginPage = (function () {
4+
function LoginPage(container) {
5+
var _this = this;
6+
container.on("click", ".login-link", function (item) {
7+
_this.login();
8+
});
9+
container.on("click", ".login-link", function (item) {
10+
this.login();
11+
});
12+
}
13+
LoginPage.prototype.login = function () {
14+
console.log("logged in");
15+
};
16+
return LoginPage;
17+
})();
18+
Pages.LoginPage = LoginPage;
19+
})(Pages || (Pages = {}));

Chapter 12/arrow.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
module Pages{
2-
export class LoginPage{
3-
constructor(container: JQuery) {
4-
container.on("click", ".login-link", (item) => {
5-
this.login();
6-
});
7-
container.on("click", ".login-link", function(item) {
8-
this.login();
9-
});
10-
}
11-
12-
login(){
13-
console.log("logged in");
14-
}
15-
}
1+
module Pages{
2+
export class LoginPage{
3+
constructor(container: JQuery) {
4+
container.on("click", ".login-link", (item) => {
5+
this.login();
6+
});
7+
container.on("click", ".login-link", function(item) {
8+
this.login();
9+
});
10+
}
11+
12+
login(){
13+
console.log("logged in");
14+
}
15+
}
1616
}

Chapter 12/castle2.js

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
var __extends = this.__extends || function (d, b) {
2-
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
3-
function __() { this.constructor = d; }
4-
__.prototype = b.prototype;
5-
d.prototype = new __();
6-
};
7-
var Westeros;
8-
(function (Westeros) {
9-
(function (Buildings) {
10-
var BaseStructure = (function () {
11-
function BaseStructure() {
12-
console.log("Structure built");
13-
}
14-
return BaseStructure;
15-
})();
16-
Buildings.BaseStructure = BaseStructure;
17-
18-
var Castle = (function (_super) {
19-
__extends(Castle, _super);
20-
function Castle(name) {
21-
_super.call(this);
22-
this.name = name;
23-
}
24-
Castle.prototype.Build = function () {
25-
console.log("Castle built: " + this.name);
26-
};
27-
return Castle;
28-
})(BaseStructure);
29-
Buildings.Castle = Castle;
30-
})(Westeros.Buildings || (Westeros.Buildings = {}));
31-
var Buildings = Westeros.Buildings;
32-
})(Westeros || (Westeros = {}));
1+
var __extends = this.__extends || function (d, b) {
2+
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
3+
function __() { this.constructor = d; }
4+
__.prototype = b.prototype;
5+
d.prototype = new __();
6+
};
7+
var Westeros;
8+
(function (Westeros) {
9+
(function (Buildings) {
10+
var BaseStructure = (function () {
11+
function BaseStructure() {
12+
console.log("Structure built");
13+
}
14+
return BaseStructure;
15+
})();
16+
Buildings.BaseStructure = BaseStructure;
17+
18+
var Castle = (function (_super) {
19+
__extends(Castle, _super);
20+
function Castle(name) {
21+
_super.call(this);
22+
this.name = name;
23+
}
24+
Castle.prototype.Build = function () {
25+
console.log("Castle built: " + this.name);
26+
};
27+
return Castle;
28+
})(BaseStructure);
29+
Buildings.Castle = Castle;
30+
})(Westeros.Buildings || (Westeros.Buildings = {}));
31+
var Buildings = Westeros.Buildings;
32+
})(Westeros || (Westeros = {}));

Chapter 12/castle2.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
module Westeros.Buildings{
2-
export class BaseStructure{
3-
constructor() {
4-
console.log("Structure built");
5-
}
6-
}
7-
8-
export class Castle extends BaseStructure{
9-
constructor(public name){
10-
super();
11-
}
12-
public Build(){
13-
console.log("Castle built: " + this.name);
14-
}
15-
}
1+
module Westeros.Buildings{
2+
export class BaseStructure{
3+
constructor() {
4+
console.log("Structure built");
5+
}
6+
}
7+
8+
export class Castle extends BaseStructure{
9+
constructor(public name){
10+
super();
11+
}
12+
public Build(){
13+
console.log("Castle built: " + this.name);
14+
}
15+
}
1616
}

Chapter 12/traceur1.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
class BaseStructure {
2-
constructor() {
3-
console.log("Structure built");
4-
}
5-
}
6-
7-
class Castle extends BaseStructure {
8-
constructor(name){
9-
this.name = name;
10-
super();
11-
}
12-
Build(){
13-
console.log("Castle built: " + this.name);
14-
}
15-
}
1+
class BaseStructure {
2+
constructor() {
3+
console.log("Structure built");
4+
}
5+
}
6+
7+
class Castle extends BaseStructure {
8+
constructor(name){
9+
this.name = name;
10+
super();
11+
}
12+
Build(){
13+
console.log("Castle built: " + this.name);
14+
}
15+
}

Chapter 12/traceur3.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
var army1Size = 5000;
2-
var army2Size = 3578;
3-
console.log(`The surviving army will be ${army1Size > army2Size ? "Army 1": "Army 2"}`);
1+
var army1Size = 5000;
2+
var army2Size = 3578;
3+
console.log(`The surviving army will be ${army1Size > army2Size ? "Army 1": "Army 2"}`);

Chapter 12/traceur4.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
if(true)
2-
{
3-
var outside = 9;
4-
let inside = 7;
5-
}
6-
7-
console.log(outside);
1+
if(true)
2+
{
3+
var outside = 9;
4+
let inside = 7;
5+
}
6+
7+
console.log(outside);
88
console.log(inside);

Chapter 12/traceur5.js

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
function timeout(ms) {
2-
return new Promise((resolve) => {
3-
setTimeout(resolve, ms);
4-
});
5-
}
6-
7-
async function asyncValue(value) {
8-
await timeout(1500);
9-
return value;
10-
}
11-
12-
(async function() {
13-
console.log("Starting.");
14-
var valuePromise = asyncValue(42).catch(console.error.bind(console));
15-
console.log("Task is running in the background.");
16-
console.log("Awaiting the promise.");
17-
var value = await valuePromise;
18-
console.log("Promise resolved.");
19-
assert.equal(42, value);
20-
console.log(value);
21-
done();
1+
function timeout(ms) {
2+
return new Promise((resolve) => {
3+
setTimeout(resolve, ms);
4+
});
5+
}
6+
7+
async function asyncValue(value) {
8+
await timeout(1500);
9+
return value;
10+
}
11+
12+
(async function() {
13+
console.log("Starting.");
14+
var valuePromise = asyncValue(42).catch(console.error.bind(console));
15+
console.log("Task is running in the background.");
16+
console.log("Awaiting the promise.");
17+
var value = await valuePromise;
18+
console.log("Promise resolved.");
19+
assert.equal(42, value);
20+
console.log(value);
21+
done();
2222
})();

0 commit comments

Comments
 (0)