Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(660)

Unified Diff: mojo/apps/js/test/js_to_cpp_unittest.js

Issue 282063003: Fix handling of null pointers in JS bindings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix accidental shadowing of parameter with local in JS side. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/apps/js/test/js_to_cpp_unittest.cc ('k') | mojo/public/js/bindings/codec.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/apps/js/test/js_to_cpp_unittest.js
diff --git a/mojo/apps/js/test/js_to_cpp_unittest.js b/mojo/apps/js/test/js_to_cpp_unittest.js
index 86d395bcf5d7b1877409a72d6981db701540e12d..9ce456e70e5b9b85ba8c4f6b1e0aceb0f28a505a 100644
--- a/mojo/apps/js/test/js_to_cpp_unittest.js
+++ b/mojo/apps/js/test/js_to_cpp_unittest.js
@@ -29,13 +29,15 @@ define('mojo/apps/js/test/js_to_cpp_unittest', [
this.cppSide_.pingResponse();
};
- JsSideConnection.prototype.echo = function (numIterations, arg) {
- var arg2;
+ JsSideConnection.prototype.echo = function (numIterations, list) {
+ var arg = list.item;
var dataPipe1;
var dataPipe2;
var i;
var messagePipe1;
var messagePipe2;
+ var resultList;
+ var specialArg;
// Ensure expected negative values are negative.
if (arg.si64 > 0)
@@ -59,18 +61,24 @@ define('mojo/apps/js/test/js_to_cpp_unittest', [
arg.data_handle = dataPipe1.consumerHandle;
arg.message_handle = messagePipe1.handle1;
- arg2 = new jsToCpp.EchoArgs();
- arg2.si64 = -1;
- arg2.si32 = -1;
- arg2.si16 = -1;
- arg2.si8 = -1;
- arg2.name = 'going';
- arg2.data_handle = dataPipe2.consumerHandle;
- arg2.message_handle = messagePipe2.handle1;
+ specialArg = new jsToCpp.EchoArgs();
+ specialArg.si64 = -1;
+ specialArg.si32 = -1;
+ specialArg.si16 = -1;
+ specialArg.si8 = -1;
+ specialArg.name = 'going';
+ specialArg.data_handle = dataPipe2.consumerHandle;
+ specialArg.message_handle = messagePipe2.handle1;
writeDataPipe(dataPipe1, senderData);
writeDataPipe(dataPipe2, senderData);
- this.cppSide_.echoResponse(arg, arg2);
+
+ resultList = new jsToCpp.EchoArgsList();
+ resultList.next = new jsToCpp.EchoArgsList();
+ resultList.item = specialArg;
+ resultList.next.item = arg;
+
+ this.cppSide_.echoResponse(resultList);
core.close(dataPipe1.producerHandle);
core.close(dataPipe2.producerHandle);
« no previous file with comments | « mojo/apps/js/test/js_to_cpp_unittest.cc ('k') | mojo/public/js/bindings/codec.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698