diff options
author | Grant Gayed <ggayed> | 2009-12-21 19:15:57 +0000 |
---|---|---|
committer | Grant Gayed <ggayed> | 2009-12-21 19:15:57 +0000 |
commit | 216f5ab7fb691dae8d48f705c5a563bf2b62146e (patch) | |
tree | 366def3534db8fe72cdaec883c2e56a8657a43ca /bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/External.java | |
parent | 7ea7044dce58068771791c523ae5bf28b951b0a6 (diff) | |
download | eclipse.platform.swt-216f5ab7fb691dae8d48f705c5a563bf2b62146e.tar.gz eclipse.platform.swt-216f5ab7fb691dae8d48f705c5a563bf2b62146e.tar.xz eclipse.platform.swt-216f5ab7fb691dae8d48f705c5a563bf2b62146e.zip |
298230 - BrowserFunction does not handle empty arrays properly
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/External.java')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/External.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/External.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/External.java index 53ed58f3b7..e888c3224a 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/External.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/External.java @@ -503,7 +503,10 @@ nsIVariant convertToJS (Object value, nsIComponentManager componentManager) { if (value instanceof Object[]) { Object[] arrayValue = (Object[])value; int length = arrayValue.length; - if (length > 0) { + if (length == 0) { + rc = variant.SetAsEmptyArray (); + if (rc != XPCOM.NS_OK) Mozilla.error (rc); + } else { int /*long*/ arrayPtr = C.malloc (C.PTR_SIZEOF * length); for (int i = 0; i < length; i++) { Object currentObject = arrayValue[i]; @@ -529,8 +532,8 @@ nsIVariant convertToJS (Object value, nsIComponentManager componentManager) { C.free (idPtr); C.free (arrayPtr); if (rc != XPCOM.NS_OK) Mozilla.error (rc); - return variant; } + return variant; } variant.Release (); |