divyang4481 / firebreath

Automatically exported from code.google.com/p/firebreath
0 stars 0 forks source link

Wrapping of size_t return type does not work for JSAPIAuto objects #98

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
{{{

class TestAPI : JSAPIAuto {
    TestAPI() { registerProperty("bug", make_property(this, &TestAPI::GetBug)); }
    size_t GetBug() { return 1; }
}

}}}

When calling obj.bug from JS in Firefox (didn't test other browsers),
a value of "undefined" is returned.

This is also evident when trying to create JS(Fake)Array objects like this:
{{{

class TestAPI : JSAPIAuto {
    TestAPI() { registerMetod("bug", make_methoid(this, &TestAPI::GetBug)); }
    FB::JSAPIPtr GetBug() { return FB::JSAPIPtr(new FB::JSArray()); }
}

When calling obj.bug().length again undefined is returned.

}}}

Adding size_t conversion to variant.h (near line 680) didn't make a difference.

Tested on Fedora 13 Firefox 3.6.12 64bit.
Compiler: gcc (GCC) 4.4.4 20100630 (Red Hat 4.4.4-10)

Original issue reported on code.google.com by ant...@gmail.com on 3 Nov 2010 at 4:41

GoogleCodeExporter commented 8 years ago
I can confirm that on OSX - the problem is in NpapiBrowserHost::getNPVariant(), 
unsigned long is missing there.
There also is another problem with it - it assumes that sizeof(long)<=4.

Original comment by georg.fritzsche on 6 Nov 2010 at 2:21

GoogleCodeExporter commented 8 years ago
We have a fix and refactoring for that in dev, if it tests well on Windows etc. 
we will apply the fix to stable too:
http://code.google.com/p/firebreath/source/detail?r=9ce70e0b1ed06b0e3ee68d1eb48b
c57d77d7575c&repo=dev

Original comment by georg.fritzsche on 6 Nov 2010 at 6:31

GoogleCodeExporter commented 8 years ago

Original comment by georg.fritzsche on 7 Nov 2010 at 12:26