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

Unified Diff: tools/json_schema_compiler/js_externs_generator_test.py

Issue 2766363002: [Closure Externs] Handle optional params sent to an API callback (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | tools/json_schema_compiler/js_util.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/js_externs_generator_test.py
diff --git a/tools/json_schema_compiler/js_externs_generator_test.py b/tools/json_schema_compiler/js_externs_generator_test.py
index 88c2a09f04d0773e10fa5643d730557c2cf42975..fe7ab688d03c509e18958bc1870dfa061cf175b3 100755
--- a/tools/json_schema_compiler/js_externs_generator_test.py
+++ b/tools/json_schema_compiler/js_externs_generator_test.py
@@ -63,6 +63,8 @@ namespace fakeApi {
callback BazGreekCallback = void(Baz baz, Greek greek);
+ callback OptionalParamCallback = void(optional Qux qux);
+
interface Functions {
// Does something exciting! And what's more, this is a multiline function
// comment! It goes onto multiple lines!
@@ -75,6 +77,8 @@ namespace fakeApi {
static void bazGreek(optional BazGreekCallback callback);
[deprecated="Use a new method."] static DOMString returnString();
+
+ static void optionalParam(optional OptionalParamCallback callback);
};
interface Events {
@@ -205,6 +209,12 @@ chrome.fakeApi.bazGreek = function(callback) {};
chrome.fakeApi.returnString = function() {};
/**
+ * @param {function(!chrome.fakeApi.Qux|undefined):void=} callback
+ * @see https://developer.chrome.com/extensions/fakeApi#method-optionalParam
+ */
+chrome.fakeApi.optionalParam = function(callback) {};
+
+/**
* Fired when we realize it's a trap!
* @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/fakeApi#event-onTrapDetected
« no previous file with comments | « no previous file | tools/json_schema_compiler/js_util.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698