我使用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