Closed Bug 611672 Opened 9 years ago Closed 9 years ago

NPN_Construct doesn't work on native JS functions


(Core :: Plug-ins, defect)

Windows 7
Not set





(Reporter: benjamin, Assigned: benjamin)



(1 file)

NPN_Construct was added to NPAPI a while back, but currently it doesn't work on native JS functions. It only works in the other direction such that content JS can construct objects provided by the plugin. This is because of a logic error in nsJSNPRuntime which is calling JS_ConstructObjectWithArguments using js::FunctionClass instead of using JS_New, which constructs an object using the correct class.
Attachment #490093 - Flags: review?(jst)
Comment on attachment 490093 [details] [diff] [review]
Use JS_New, rev. 1

- In modules/plugin/test/mochitest/test_npruntime_construct.html:

+  <style type="text/css">
+  body {
+    height: 4000px;
+  }
+  </style>

I don't mind this being here if it's for a reason, but I fail to see a reason for it here.

r=jst either way.
Attachment #490093 - Flags: review?(jst) → review+
Yeah, that was a bad copy-paste from test_positioning.html (with wrong bug#, bah)
Closed: 9 years ago
Resolution: --- → FIXED
I just crashed trying to update Silverlight via Mozilla's plugincheck page with
the latest Minefield nightly on Mac OS X 10.6.5. I clicked on the update button
for Silverlight and crashed on the following Silverlight page:

Pretty easy to repro by reloading that URL, I only have to reload the page a couple of times to get it to happen.

My crash report is here:

All four reports of this in our database for 4.0b8pre have come within the past two days. Two are from me.

This bug comes to mind as a potential cause because it was the last direct modification to NPRuntime and Silverlight is probably doing a lot of script interaction on that page.
I filed bug 616400.
You need to log in before you can comment on or make changes to this bug.