File tree 1 file changed +49
-7
lines changed
1 file changed +49
-7
lines changed Original file line number Diff line number Diff line change @@ -108,12 +108,50 @@ run
108
108
109
109
110
110
## やらなきゃいけない事
111
- 1 . class実装
112
- 2 . 循環参照問題
113
- 3 . coffee特有の対応
114
-
115
-
116
-
111
+ 1 . serializeする必要のないJS実装を除外
112
+ 2 . class実装
113
+ 3 . 循環参照問題
114
+ 4 . coffee特有の対応
115
+
116
+
117
+ ### 1. serializeする必要のないJS実装を除外
118
+ https://github.com/crumbjp/test/blob/master/coffee2string/coffee2string.coffee#L3
119
+ - __ defineGetter__
120
+ - __ defineSetter__
121
+ - __ lookupGetter__
122
+ - __ lookupSetter__
123
+ - constructor
124
+ - hasOwnProperty
125
+ - isPrototypeOf
126
+ - propertyIsEnumerable
127
+ - toLocaleString
128
+ - toString
129
+ - valueOf
130
+ - apply
131
+ - arguments
132
+ - bind
133
+ - call
134
+ - caller
135
+ - length
136
+ - name
137
+ - prototype
138
+
139
+ ### 2. class実装
140
+ https://github.com/crumbjp/test/blob/master/coffee2string/coffee2string.coffee#L89
141
+ ` __super__ ` はcoffeeの独自実装で、superクラスがそのまま入っている
142
+
143
+ ### 3. 循環参照問題
144
+ https://github.com/crumbjp/test/blob/master/coffee2string/coffee2string.coffee#L44
145
+ Objectをトラバースする際、Objectを発見したら全て変数に起き直す
146
+ 循環参照を発見したら、同じ参照を置いておけば良い。
147
+ https://github.com/crumbjp/test/blob/master/coffee2string/coffee2string.coffee#L72
148
+
149
+ ### 4. coffee特有の対応
150
+ おまじないを置いておく必要がある
151
+ https://github.com/crumbjp/test/blob/master/coffee2string/coffee2string.coffee#L35
152
+
153
+
154
+ ## 結果
117
155
``` js
118
156
coffee2string = require ' ./coffee2string'
119
157
jsString = coffee2string Foo
@@ -155,4 +193,8 @@ Foo.prototype['run'] = function () {
155
193
}
156
194
157
195
Foo::bar
158
- ```
196
+ ```
197
+
198
+ ## 残課題
199
+ ` require ` 問題が残っている
200
+ 結局、erlangの様に言語レベルでRPCが想定されていない限り、ある程度のお約束事を規定するしか無いようだ。
You can’t perform that action at this time.
0 commit comments