by keigoi

日本語の解説 †

http://d.hatena.ne.jp/keigoi/20101101/1288584308

ocamljs バグ †

  • max_int がおかしい(JSのintの範囲をこえる)ので closure compilerで圧縮できない
    • 修正ずみ
  • string_of_float min_floatがSafari/webkitでおかしい
    • Safariのバグ。最新のwebkitビルドでは直っている。min_floatは使わないこと
  • 一部日本語文字列リテラルが化ける (未報告)
    • src/jscomp/jsgen.ml を以下の通りコメントアウトしてみる
      let utf8_encode s = s
      (*  let len = String.length s in
        Utf8.from_int_array (Array.init len (fun i -> Char.code s.[i])) 0 len *)
    • 日本語文字が"\u5E74"のようにエスケープされてしまうが、一応直った
  • DateクラスのgetDayメソッド(曜日を取得)がない (未報告) http://jaked.github.com/ocamljs/doc/Javascript.date-c.html https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/getDay
  • getClientWidth?/getClientHeight?がない ← DOM標準ではないのでしょうがない?

ocamljs そのほか †

  • closure compilerでsimple圧縮すると動かなかった(keigoiの日記参照)が修正された。
  • 次のコード (Dom.documentに意味はない; なんでもいい)
    let f (e:Dom.element) = (fun e -> e#removeChild (Dom.document :> Dom.element)) e
    でエラー
    Error: This expression (右端のe) has type
             D.element =
               < _get_accessKey : string;
     (49個のメソッドが続く…)
                 removeChild : 'n 'o. (< .. > as 'n) -> (< .. > as 'o);
                 removeEventListener : string ->
                                       (D.event -> unit) -> bool -> unit;
                 removeEventListener_keyEvent_ : string ->
                                                 (D.keyEvent -> unit) ->
                                                 bool -> unit;
                 removeEventListener_mouseEvent_ : string ->
                                                   (D.mouseEvent -> unit) ->
                                                   bool -> unit;
                 replaceChild : 'p 'q 'r.
                                  (< .. > as 'p) ->
                                  (< .. > as 'q) -> (< .. > as 'r);
                 setAttribute : string -> string -> unit >
           but an expression was expected of type
             < removeChild : D.element -> 's; .. >
           Type 'n is not compatible with type
             D.element =
               < _get_accessKey : string;
     (49個のメソッドが続く…)
                 removeChild : 'n 'o. (< .. > as 'n) -> (< .. > as 'o);
                 removeEventListener : string ->
                                       (D.event -> unit) -> bool -> unit;
                 removeEventListener_keyEvent_ : string ->
                                                 (D.keyEvent -> unit) ->
                                                 bool -> unit;
                 removeEventListener_mouseEvent_ : string ->
                                                   (D.mouseEvent -> unit) ->
                                                   bool -> unit;
                 replaceChild : 'p 'q 'r.
                                  (< .. > as 'p) ->
                                  (< .. > as 'q) -> (< .. > as 'r);
                 setAttribute : string -> string -> unit > 
           The first object type has no method _get_accessKey
    これは
    let f (e:Dom.element) = (fun e -> (e:>Dom.element)#removeChild (Dom.document :> Dom.element)) e
    とすれば通るが、なぜか。
トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS