Fix for setting properties through RPC
This commit is contained in:
parent
ebb400ed41
commit
3c9fb1a323
|
@ -122,11 +122,11 @@ static JSGlobalContextRef s_context;
|
|||
return @{@"result": [self resultForJSValue:propertyValue]};
|
||||
};
|
||||
s_requests["/set_property"] = [=](NSDictionary *dict) {
|
||||
JSValueRef exception = NULL;
|
||||
JSStringRef propString = RJSStringForString([dict[@"name"] UTF8String]);
|
||||
RPCObjectID realmId = [dict[@"realmId"] longValue];
|
||||
JSValueRef value = [[JSValue valueWithObject:dict[@"value"]
|
||||
inContext:[JSContext contextWithJSGlobalContextRef:s_context]] JSValueRef];
|
||||
RPCObjectID realmId = [dict[@"objectId"] longValue];
|
||||
JSValueRef value = [self valueFromDictionary:dict[@"value"]];
|
||||
JSValueRef exception = NULL;
|
||||
|
||||
ObjectSetProperty(s_context, s_objects[realmId], propString, value, &exception);
|
||||
JSStringRelease(propString);
|
||||
|
||||
|
|
|
@ -71,6 +71,7 @@ function getObjectProperty(realmId, objectId, name) {
|
|||
}
|
||||
|
||||
function setObjectProperty(realmId, objectId, name, value) {
|
||||
value = serialize(realmId, value);
|
||||
sendRequest('set_property', {realmId, objectId, name, value});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue