File tree Expand file tree Collapse file tree 9 files changed +16
-38
lines changed
definition-file/declareClass Expand file tree Collapse file tree 9 files changed +16
-38
lines changed Original file line number Diff line number Diff line change 11GIT
22 remote: https://github.com/kmuto/review.git
3- revision: 2a20a0904a6380ff44af77ee1224f4035af62ea3
3+ revision: eb6845763b8875b89af997277abd0c158f8092b9
44 specs:
55 review (2.0.0 )
66 rubyzip
Original file line number Diff line number Diff line change @@ -811,22 +811,12 @@ class Cat extends Animal {
811811let cat: Cat = new Cat () ;
812812console. log(cat. speak() );
813813
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-
826814export { }
827815#@ end
828816// }
829817
818+ #@# TODO https: // github.com/Microsoft/TypeScript/issues/10624 の結果次第で削ったコードを復活させる
819+
830820#@# OK REVIEW lc: s/ 以下のような分/ 以下のような文/
831821
832822=== {pretty- good- overload} オーバーロードを上手く使おう!
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ C87版から上手に味わいを引き継いだ可愛い表紙をありがと
3838
3939本書で利用しているTypeScriptコンパイラは次のものです。
4040#@mapoutput (../node_modules/.bin /tsc -v | sed -e " s/\n //" )
41- Version 2.0.0
41+ Version 2.0.2
4242#@end
4343
4444// 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
1717# 省略
1818$ tsc -v
1919#@mapoutput (../node_modules/.bin /tsc -v)
20- Version 2.0.0
20+ Version 2.0.2
2121#@end
2222$ echo " class Sample {}" > sample.ts
2323$ tsc sample.ts
@@ -55,7 +55,7 @@ package.json
5555$ npm install --save-dev typescript
5656$ ./node_modules/.bin /tsc -v
5757#@mapoutput (../node_modules/.bin /tsc -v)
58- Version 2.0.0
58+ Version 2.0.2
5959#@end
6060// }
6161
@@ -71,7 +71,7 @@ $ npm bin
7171$PWD/node_modules/.bin 的なパスが表示される
7272$ $(npm bin)/tsc -v
7373#@mapoutput (../node_modules/.bin /tsc -v)
74- Version 2.0.0
74+ Version 2.0.2
7575#@end
7676// }
7777
Original file line number Diff line number Diff line change @@ -1149,8 +1149,8 @@ export { }
11491149// list[localType/basic.ts][ローカル型を試す]{
11501150#@ mapfile(../ code/ types- advanced/ localType/ basic. ts)
11511151{
1152- type Data = string | boolean ;
1153- let obj : Data = true ;
1152+ type Data = string | number ;
1153+ let obj : Data = 1 ;
11541154
11551155 console. log(obj);
11561156}
Original file line number Diff line number Diff line change @@ -330,8 +330,8 @@ class Animal {
330330// error TS2511: Cannot create an instance of the abstract class 'Animal'.
331331// new Animal();
332332class Cat extends Animal {
333- constructor (...args ) {
334- super (...args );
333+ constructor () {
334+ super (...arguments );
335335 // プロパティの実装を強制される
336336 this .name = " Cat" ;
337337 this .poo = " poo..." ;
Original file line number Diff line number Diff line change @@ -32,16 +32,4 @@ class Cat extends Animal {
3232let cat : Cat = new Cat ( ) ;
3333console . log ( cat . speak ( ) ) ;
3434
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-
4735export { }
Original file line number Diff line number Diff line change 11{
2- type Data = string | boolean ;
3- let obj : Data = true ;
2+ type Data = string | number ;
3+ let obj : Data = 1 ;
44
55 console . log ( obj ) ;
66}
Original file line number Diff line number Diff line change 2020 "dependencies" : {},
2121 "devDependencies" : {
2222 "@types/mocha" : " ^2.2.28" ,
23- "@types/node" : " ^4 .0.30 " ,
23+ "@types/node" : " ^6 .0.38 " ,
2424 "@types/power-assert" : " ^0.0.27" ,
2525 "grunt" : " ^1.0.1" ,
2626 "grunt-cli" : " ^1.2.0" ,
3232 "load-grunt-tasks" : " ^3.5.0" ,
3333 "node-sass" : " ^3.8.0" ,
3434 "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"
3737 }
3838}
You can’t perform that action at this time.
0 commit comments