Skip to content

Commit

Permalink
Merge 3d8ae95 into 6fcd3e6
Browse files Browse the repository at this point in the history
  • Loading branch information
angshuman-agarwal authored Jul 8, 2019
2 parents 6fcd3e6 + 3d8ae95 commit 7e4b21f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2015 The CefSharp Authors. All rights reserved.
// Copyright © 2015 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Expand Down Expand Up @@ -59,20 +59,17 @@ namespace CefSharp
{
int arrLength = obj->GetArrayLength();
std::vector<CefString> keys;
auto array = CefListValue::Create();
if (arrLength > 0 && obj->GetKeys(keys))
{
auto array = CefListValue::Create();
for (int i = 0; i < arrLength; i++)
{
SerializeV8Object(obj->GetValue(keys[i]), array, i, callbackRegistry, seen);
}

list->SetList(index, array);
}
else
{
list->SetNull(index);
}

list->SetList(index, array);
}
else if (obj->IsFunction())
{
Expand Down
11 changes: 11 additions & 0 deletions CefSharp.Example/Resources/BindingTest.html
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,17 @@
});
});

QUnit.test("Async call (Test Empty Array):", function (assert) {
var asyncCallback = assert.async();

boundAsync.echoArray([]).then(function (res) {
assert.equal(Array.isArray(res), true, "Expected result is an array");
assert.equal(res.length, 0, "Expected result to be length 0 (empty array)");
asyncCallback();
});
});


QUnit.test("Async call (echoValueTypeArray):", function (assert)
{
var asyncCallback = assert.async();
Expand Down

0 comments on commit 7e4b21f

Please sign in to comment.