String thisObjectId = null;
final List<CallArgumentParam> additionalObjectIds = new ArrayList<CallArgumentParam>(0);
String tempObjectRef = GLOBAL_VARIABLE_NAME + ".data." + dataId + ".";
for (Map.Entry<String, ? extends SerializableValue> entry : additionalContext.entrySet()) {
SerializableValue jsValueBase = entry.getValue();
String commandParamName;
if (thisObjectId == null && jsValueBase.getRefId() != null) {
commandParamName = "this";
thisObjectId = jsValueBase.getRefId();
} else {
commandParamName = "p" + additionalObjectIds.size();
CallArgumentParam callArgumentParam = jsValueBase.createCallArgumentParam();
if (callArgumentParam == null) {
throw new IllegalArgumentException("Cannot serialize additional context property " +
entry.getKey());
}
additionalObjectIds.add(callArgumentParam);