[Project_owners] Converting C code to Javascript/what am I doing wrong?

Michael Vincent mv_van_rantwijk at yahoo.com
Tue Aug 23 18:08:02 EDT 2005


Neil Deakin wrote:
> Michael Vincent wrote:
> 
>> I'm trying to rewrite a perfectly working piece is code in JavaScript, 
>> because I need something that isn't available, and I don't have a C 
>> compiler nor do I want to build Mozilla myself simple because I can't 
>> use it.
>>
>> The following code fails in RDFCUtils.MakeSeq() but I don't see why:
>>
>>   var kNC = "rdf:http://home.netscape.com/NC-rdf#";
>>   var datasource = RDF.GetDataSource("rdf:bookmarks");
>>   var livemarkResource = RDF.GetAnonymousResource();
>>   var container = RDFCUtils.MakeSeq(datasource, 
>> RDF.GetResource(livemarkResource.Value));
>>
>>
>> It should do exactly the same as:
>> http://lxr.mozilla.org/aviary101branch/source/browser/components/bookmarks/src/nsBookmarksService.cpp#2845 
>>
>>
> It doesn't do exactly the same. Your code calls MakeSeq with the 
> bookmarks datasource, whereas the bookmarks service calls it with the 
> inner in-memory-datasource that actually stores the bookmarks. The 
> former doesn't allow some kinds of changes to be made (see 
> nsBookmarksService::CanAccept).
> 
> / Neil

So are you saying that it can't be done in JavaScript or that I should 
use a different datasource and if yes, which one?

Michael


More information about the Project_owners mailing list