File tree 9 files changed +16
-38
lines changed
definition-file/declareClass
9 files changed +16
-38
lines changed Original file line number Diff line number Diff line change 1
1
GIT
2
2
remote: https://github.com/kmuto/review.git
3
- revision: 2a20a0904a6380ff44af77ee1224f4035af62ea3
3
+ revision: eb6845763b8875b89af997277abd0c158f8092b9
4
4
specs:
5
5
review (2.0.0 )
6
6
rubyzip
Original file line number Diff line number Diff line change @@ -811,22 +811,12 @@ class Cat extends Animal {
811
811
let cat: Cat = new Cat () ;
812
812
console. log(cat. speak() );
813
813
814
- // ECMAScript 2015だと次のような文すら書けるのでまぁできて然るべきだった
815
- let cat2: Cat = new class extends class {
816
- speak() {
817
- return "???" ;
818
- }
819
- } {
820
- speak() {
821
- return "meow" ;
822
- }
823
- }() ;
824
- console. log(cat2. speak() );
825
-
826
814
export { }
827
815
#@ end
828
816
// }
829
817
818
+ #@# TODO https: // github.com/Microsoft/TypeScript/issues/10624 の結果次第で削ったコードを復活させる
819
+
830
820
#@# OK REVIEW lc: s/ 以下のような分/ 以下のような文/
831
821
832
822
=== {pretty- good- overload} オーバーロードを上手く使おう!
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ C87版から上手に味わいを引き継いだ可愛い表紙をありがと
38
38
39
39
本書で利用しているTypeScriptコンパイラは次のものです。
40
40
#@mapoutput (../node_modules/.bin /tsc -v | sed -e " s/\n //" )
41
- Version 2.0.0
41
+ Version 2.0.2
42
42
#@end
43
43
44
44
// footnote[js-primer][@<href>{https://github.com/asciidwango/js-primer}]
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ $ npm install -g typescript
17
17
# 省略
18
18
$ tsc -v
19
19
#@mapoutput (../node_modules/.bin /tsc -v)
20
- Version 2.0.0
20
+ Version 2.0.2
21
21
#@end
22
22
$ echo " class Sample {}" > sample.ts
23
23
$ tsc sample.ts
@@ -55,7 +55,7 @@ package.json
55
55
$ npm install --save-dev typescript
56
56
$ ./node_modules/.bin /tsc -v
57
57
#@mapoutput (../node_modules/.bin /tsc -v)
58
- Version 2.0.0
58
+ Version 2.0.2
59
59
#@end
60
60
// }
61
61
@@ -71,7 +71,7 @@ $ npm bin
71
71
$PWD/node_modules/.bin 的なパスが表示される
72
72
$ $(npm bin)/tsc -v
73
73
#@mapoutput (../node_modules/.bin /tsc -v)
74
- Version 2.0.0
74
+ Version 2.0.2
75
75
#@end
76
76
// }
77
77
Original file line number Diff line number Diff line change @@ -1149,8 +1149,8 @@ export { }
1149
1149
// list[localType/basic.ts][ローカル型を試す]{
1150
1150
#@ mapfile(../ code/ types- advanced/ localType/ basic. ts)
1151
1151
{
1152
- type Data = string | boolean ;
1153
- let obj : Data = true ;
1152
+ type Data = string | number ;
1153
+ let obj : Data = 1 ;
1154
1154
1155
1155
console. log(obj);
1156
1156
}
Original file line number Diff line number Diff line change @@ -330,8 +330,8 @@ class Animal {
330
330
// error TS2511: Cannot create an instance of the abstract class 'Animal'.
331
331
// new Animal();
332
332
class Cat extends Animal {
333
- constructor (...args ) {
334
- super (...args );
333
+ constructor () {
334
+ super (...arguments );
335
335
// プロパティの実装を強制される
336
336
this .name = " Cat" ;
337
337
this .poo = " poo..." ;
Original file line number Diff line number Diff line change @@ -32,16 +32,4 @@ class Cat extends Animal {
32
32
let cat : Cat = new Cat ( ) ;
33
33
console . log ( cat . speak ( ) ) ;
34
34
35
- // ECMAScript 2015だと次のような文すら書けるのでまぁできて然るべきだった
36
- let cat2 : Cat = new class extends class {
37
- speak ( ) {
38
- return "???" ;
39
- }
40
- } {
41
- speak ( ) {
42
- return "meow" ;
43
- }
44
- } ( ) ;
45
- console . log ( cat2 . speak ( ) ) ;
46
-
47
35
export { }
Original file line number Diff line number Diff line change 1
1
{
2
- type Data = string | boolean ;
3
- let obj : Data = true ;
2
+ type Data = string | number ;
3
+ let obj : Data = 1 ;
4
4
5
5
console . log ( obj ) ;
6
6
}
Original file line number Diff line number Diff line change 20
20
"dependencies" : {},
21
21
"devDependencies" : {
22
22
"@types/mocha" : " ^2.2.28" ,
23
- "@types/node" : " ^4 .0.30 " ,
23
+ "@types/node" : " ^6 .0.38 " ,
24
24
"@types/power-assert" : " ^0.0.27" ,
25
25
"grunt" : " ^1.0.1" ,
26
26
"grunt-cli" : " ^1.2.0" ,
32
32
"load-grunt-tasks" : " ^3.5.0" ,
33
33
"node-sass" : " ^3.8.0" ,
34
34
"tslint" : " ^3.13.0" ,
35
- "typescript" : " ^2.0.0 " ,
36
- "typescript-formatter" : " ^2.3 .0"
35
+ "typescript" : " ^2.0.2 " ,
36
+ "typescript-formatter" : " ^3.0 .0"
37
37
}
38
38
}
You can’t perform that action at this time.
0 commit comments