我使用firebreath框架編寫一個瀏覽器插件沒有的toString()函數。當我使用的插件使用javascript我得到一個奇怪的錯誤:Firebreath JavaScript錯誤:不支持的:在類型功能
unsupported: no toString() function in type function
wheny我打電話幾次基於返回JSAPIPtr我Dropbox_pluginAPI類中的方法我得到這個錯誤。
下面是代碼:
//JavaScript context
for(var i=0; i<100; i++)
{
//After several times of calling the method I get the error: unsupported: no toString() function in type function
var md = plugin().getMetaDataOfFileOrFolder("dropbox/demotext","null",true,false,"null");
}
//API class
FB::JSAPIPtr Dropbox_pluginAPI::getMetaDataOfFileOrFolder(std::string fileOrFolderPath,std::string hash, bool list, bool include_deleted,
std::string rev)
{
MetaData m = client->getMetaDataOfFileOrFolder(fileOrFolderPath,hash,list,include_deleted,rev);
return boost::make_shared<MetaDataAPI>(m_host,m);
}
//MetaDataAPI class
class MetaDataAPI : public FB::JSAPIAuto
{
public:
/**
* Constructor.
* @param host The browser
* @param m The MetaData object
*/
MetaDataAPI(const FB::BrowserHostPtr& host,MetaData m);
.....
.....
}
我希望有人可與firebreath,可以幫助我!
我更新了firefox版本和分離成不同的行,但錯誤仍然發生。 我做了以下內容:
var plug = plugin();
var fn = plug.getMetaDataOfFileOrFolder;
var md;
for(var i=0; i<100; i++)
{
md = fn("dropbox/demotext","null",true,false,"null");
}
alert("Finish");
該警報永遠不會被調用!還有幾個電話後錯誤:
[unsupported: no toString() function in type function]
在行:
md = fn("dropbox/demotext","null",true,false,"null");
萬一它可以幫助做鏈接,我還發現,不良的問題:http://stackoverflow.com/questions/9208441/javascript-error-unsupported-no-tostring-function-in-type-function – FMaz008 2012-02-10 13:51:00
k下一次我會做 – 2012-02-10 13:51:54
...我認爲你通過重新發佈一個更明確的問題來避免正確的事情。我真的只想把它們聯繫起來,因爲前面的評論包含了一些細節。 – FMaz008 2012-02-10 13:55:34