サーバー側のPhantomJSスクリプト内でresemble.jsを使用しようとすると、未定義のエラーがスローされ、{objectObject}を超えてログが浸透することはありません。phantom / examples / universe.jsファイルの後にパターンを作成し、元のresemble.jsファイルを回転させてみました。
(function (_this) {
_this['resemble'] = function (fileData) {
...
}
}(this));
の中へ
exports.create = function () {
(function (_this) {
_this['resemble'] = function (fileData) {
...
}
}(this));
};
と同様
exports.create = function () {
resemble = function (fileData) {
...
}
};
まず、そのぶら下がりは一体何をするの(this)
でしょうか?次に、そのオブジェクトをログに記録するにはどうすればよいですか?最後に、そのファイルをラップする適切な方法は何ですか?
ありがとう!