cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r596049 - /incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JsXMLHttpRequest.java
Date Sun, 18 Nov 2007 04:14:53 GMT
Author: bimargulies
Date: Sat Nov 17 20:14:53 2007
New Revision: 596049

URL: http://svn.apache.org/viewvc?rev=596049&view=rev
Log:
Don't try to overload in Javascript.

Modified:
    incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JsXMLHttpRequest.java

Modified: incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JsXMLHttpRequest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JsXMLHttpRequest.java?rev=596049&r1=596048&r2=596049&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JsXMLHttpRequest.java
(original)
+++ incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JsXMLHttpRequest.java
Sat Nov 17 20:14:53 2007
@@ -590,19 +590,18 @@
         doSetRequestHeader(header, value);
     }
 
-    public void jsFunction_send() {
-        doSend(null, false);
-
+    public void jsFunction_send(Object arg) {
+        if (arg == Context.getUndefinedValue()) {
+            doSend(null, false);
+        } else if (arg instanceof String) {
+            doSend(utf8Bytes((String)arg), false);
+        } else if (arg instanceof JsSimpleDomNode) {
+            doSend(domToUtf8((JsSimpleDomNode)arg), true);
+        } else {
+            throwError("INVALID_ARG_TO_SEND");
+        }
     }
 
-    public void jsFunction_send(String data) {
-        doSend(utf8Bytes(data), false);
-
-    }
-
-    public void jsFunction_send(JsSimpleDomNode xml) {
-        doSend(domToUtf8(xml), true);
-    }
 
     public void jsFunction_abort() {
         doAbort();



Mime
View raw message