Table of contents Why not use JavaScript? JavaScript has a lot of warts in the language and while the ECMAScript community is doing a good job with its upcoming revisions, it’s still left with a lot of the old cruft. Also, for those who want to code for older browsers, all the shiny new features that the newer versions of ECMAScript provide are for all intents and purposes unreachable. Some of the
原因 Phantom.jsのpage.evaluateに渡す関数は外側のスコープの変数を利用できないのに、CoffeeScriptのコンパイラが外側のスコープの変数を利用する関数を生成してしまうため。 対策 次のような関数を利用することでpage.evaluateに渡す関数が変数を自身のスコープ内のみで解決できるようにする。 toBeExecutableInBrowser = (func) -> str = func.toString().replace /\n/, '\n var __slice = [].slice;\n' eval "(#{str})" あるいは次のようにしてpage.evaluateの動作を変更し、ブラウザ内に__sliceという変数を事前に定義するようにしておく。 do () -> evaluate = page.evaluate page.evaluate =
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く