replace javaValues with values

This commit is contained in:
王劲鹏 2020-01-19 11:15:06 +08:00 committed by osborn
parent a8ffd31c8a
commit 59eed39493
4 changed files with 40 additions and 40 deletions

View File

@ -139,7 +139,7 @@ public class RemoteJSExecutor {
.put("cmd", "invokeMethod") .put("cmd", "invokeMethod")
.put("objectName", objectName) .put("objectName", objectName)
.put("functionName", functionName) .put("functionName", functionName)
.put("javaValues", jsonArray) .put("values", jsonArray)
.put("hashKey", hashKey) .put("hashKey", hashKey)
.toString()); .toString());

View File

@ -3817,25 +3817,25 @@ debugServer.on('connection', function connection(ws) {
console.log(messageObject.objectName); console.log(messageObject.objectName);
console.log(messageObject.functionName); console.log(messageObject.functionName);
let args = []; let args = [];
for (let i = 0; i < messageObject.javaValues.length; i++) { for (let i = 0; i < messageObject.values.length; i++) {
let javaValue = messageObject.javaValues[i]; let value = messageObject.values[i];
if (javaValue.type === 0) { if (value.type === 0) {
args.push(null); args.push(null);
} }
else if (javaValue.type === 1) { else if (value.type === 1) {
args.push(parseFloat(javaValue.value)); args.push(parseFloat(value.value));
} }
else if (javaValue.type === 2) { else if (value.type === 2) {
args.push((javaValue.value == 'true')); args.push((value.value == 'true'));
} }
else if (javaValue.type === 3) { else if (value.type === 3) {
args.push(javaValue.value.toString()); args.push(value.value.toString());
} }
else if (javaValue.type === 4) { else if (value.type === 4) {
args.push(JSON.parse(javaValue.value)); args.push(JSON.parse(value.value));
} }
else if (javaValue.type === 5) { else if (value.type === 5) {
args.push(JSON.parse(javaValue.value)); args.push(JSON.parse(value.value));
} }
} }
console.log(args); console.log(args);

View File

@ -91,20 +91,20 @@ debugServer.on('connection', function connection(ws) {
console.log(messageObject.functionName) console.log(messageObject.functionName)
let args = [] let args = []
for (let i = 0; i < messageObject.javaValues.length; i++) { for (let i = 0; i < messageObject.values.length; i++) {
let javaValue = messageObject.javaValues[i] let value = messageObject.values[i]
if (javaValue.type === 0) { if (value.type === 0) {
args.push(null) args.push(null)
} else if (javaValue.type === 1) { } else if (value.type === 1) {
args.push(parseFloat(javaValue.value)) args.push(parseFloat(value.value))
} else if (javaValue.type === 2) { } else if (value.type === 2) {
args.push((javaValue.value == 'true')) args.push((value.value == 'true'))
} else if (javaValue.type === 3) { } else if (value.type === 3) {
args.push(javaValue.value.toString()) args.push(value.value.toString())
} else if (javaValue.type === 4) { } else if (value.type === 4) {
args.push(JSON.parse(javaValue.value)) args.push(JSON.parse(value.value))
} else if (javaValue.type === 5) { } else if (value.type === 5) {
args.push(JSON.parse(javaValue.value)) args.push(JSON.parse(value.value))
} }
} }
console.log(args) console.log(args)

View File

@ -89,25 +89,25 @@ debugServer.on('connection', function connection(ws) {
console.log(messageObject.objectName); console.log(messageObject.objectName);
console.log(messageObject.functionName); console.log(messageObject.functionName);
let args = []; let args = [];
for (let i = 0; i < messageObject.javaValues.length; i++) { for (let i = 0; i < messageObject.values.length; i++) {
let javaValue = messageObject.javaValues[i]; let value = messageObject.values[i];
if (javaValue.type === 0) { if (value.type === 0) {
args.push(null); args.push(null);
} }
else if (javaValue.type === 1) { else if (value.type === 1) {
args.push(parseFloat(javaValue.value)); args.push(parseFloat(value.value));
} }
else if (javaValue.type === 2) { else if (value.type === 2) {
args.push((javaValue.value == 'true')); args.push((value.value == 'true'));
} }
else if (javaValue.type === 3) { else if (value.type === 3) {
args.push(javaValue.value.toString()); args.push(value.value.toString());
} }
else if (javaValue.type === 4) { else if (value.type === 4) {
args.push(JSON.parse(javaValue.value)); args.push(JSON.parse(value.value));
} }
else if (javaValue.type === 5) { else if (value.type === 5) {
args.push(JSON.parse(javaValue.value)); args.push(JSON.parse(value.value));
} }
} }
console.log(args); console.log(args);