Skip to content

Commit fc6021e

Browse files
AgapovAlexseyamaitland
authored andcommitted
Applied camelCase to field names
1 parent c4bfd44 commit fc6021e

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

CefSharp.BrowserSubprocess.Core/BindObjectAsyncHandler.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,17 @@ namespace CefSharp
215215
{
216216
auto response = CefV8Value::CreateObject(nullptr, nullptr);
217217

218-
response->SetValue("Count", CefV8Value::CreateInt(count), CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_READONLY);
219-
response->SetValue("Message", CefV8Value::CreateString(StringUtils::ToNative(message)), CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_READONLY);
220-
response->SetValue("Success", CefV8Value::CreateBool(isSuccess), CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_READONLY);
218+
const auto countResult = CefV8Value::CreateInt(count);
219+
const auto messageResult = CefV8Value::CreateString(StringUtils::ToNative(message));
220+
const auto successResult = CefV8Value::CreateBool(isSuccess);
221+
222+
response->SetValue("Count", countResult, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_READONLY);
223+
response->SetValue("Message", messageResult, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_READONLY);
224+
response->SetValue("Success", successResult, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_READONLY);
225+
226+
response->SetValue("count", countResult, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_READONLY);
227+
response->SetValue("message", messageResult, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_READONLY);
228+
response->SetValue("success", successResult, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_READONLY);
221229

222230
return response;
223231
}

CefSharp.Example/Resources/BindingTestAsync.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,4 +286,20 @@ QUnit.module('BindingTestAsync', (hooks) =>
286286
assert.ok(window.boundAsync2 === undefined, "boundAsync2 is now undefined");
287287
});
288288

289+
QUnit.test('Validate BindObjectAsync result fields:', async (assert) => {
290+
const response = await CefSharp.BindObjectAsync({ NotifyIfAlreadyBound: true, IgnoreCache: true }, 'boundAsync2');
291+
const keys = Object.getOwnPropertyDescriptors(bindResult);
292+
293+
assert.equal(true, !!keys['count'], 'count');
294+
assert.equal(true, !!keys['Count'], 'Count');
295+
296+
assert.equal(true, !!keys['message'], 'message');
297+
assert.equal(true, !!keys['Message'], 'Message');
298+
299+
assert.equal(true, !!keys['success'], 'success');
300+
assert.equal(true, !!keys['Success'], 'Success');
301+
302+
assert.equal(true, CefSharp.DeleteBoundObject('boundAsync2'), 'Object was unbound');
303+
});
304+
289305
});

0 commit comments

Comments
 (0)