diff options
Diffstat (limited to 'tests/reproducers/simple/JSToJSet/resources/JSToJava_Set.js')
-rw-r--r-- | tests/reproducers/simple/JSToJSet/resources/JSToJava_Set.js | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/reproducers/simple/JSToJSet/resources/JSToJava_Set.js b/tests/reproducers/simple/JSToJSet/resources/JSToJava_Set.js new file mode 100644 index 0000000..cf92110 --- /dev/null +++ b/tests/reproducers/simple/JSToJSet/resources/JSToJava_Set.js @@ -0,0 +1,39 @@ +function doSetTests( ){ + + var urlArgs = document.URL.split("?"); + var testParams = urlArgs[1].split(";"); + var applet = document.getElementById('jstojSetApplet'); + var field = testParams[0]; + var value = testParams[1]; + + if( value === "JavaScript"){ + if( field === "_char"){ + value = 97; + } + + if( field === "_Character"){ + value = new (applet.Packages).java.lang.Character(65); + } + + if( field === "_specialString"){ + value = "𠁎〒£$ǣ€𝍖"; + } + }else if(value.indexOf('[') != -1){ + + var elem = value.substring(1); + value = new Array(); + eval('value[0] = elem'); + + } + + eval('applet.' + field + '= value'); + + //modifiing _intArray[0] into _intArray + // _DoubleArray[0] into _DoubleArray + var nameEnd = field.indexOf('['); + if( nameEnd != -1){ + field = field.substring(0,nameEnd); + } + + applet.printNewValueAndFinish(field); +} |