From 0e1162c2c9693d2ab2222d156f204133b5894c33 Mon Sep 17 00:00:00 2001 From: seunggabi Date: Sat, 1 Sep 2018 14:08:02 +0900 Subject: [PATCH 1/2] fix: typo jsdoc and comment --- fixtures/schedule/index.html | 44 ++++++++++++------------- packages/events/EventPluginRegistry.js | 8 +++-- packages/events/ResponderEventPlugin.js | 6 ++-- 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/fixtures/schedule/index.html b/fixtures/schedule/index.html index ad5f1042f561c..c2d358ea2055f 100644 --- a/fixtures/schedule/index.html +++ b/fixtures/schedule/index.html @@ -106,7 +106,7 @@

Tests:

} function updateTestResult(testNumber, textToAddToResult) { latestResults[testNumber - 1].push(textToAddToResult); -}; +} function checkTestResult(testNumber) { let correct = true; @@ -213,18 +213,16 @@

Tests:

// Test 1 // Calls the callback with the frame when not blocked clearTestResult(1); - const test1Log = []; - const cb1Arguments = []; const cb1 = (x) => { updateTestResult(1, 'cb1 called with argument of ' + JSON.stringify(x)); - } + }; scheduleWork(cb1); updateTestResult(1, 'scheduled Cb1'); logWhenFramesStart(1, () => { displayTestResult(1); checkTestResult(1); }); -}; +} function runTestTwo() { // Test 2 @@ -258,10 +256,10 @@

Tests:

} updateTestResult(3, 'cbA' + callbackAIterations + ' called with argument of ' + JSON.stringify(x)); callbackAIterations++; - } + }; const cbB = (x) => { updateTestResult(3, 'cbB called with argument of ' + JSON.stringify(x)); - } + }; scheduleWork(cbA); updateTestResult(3, 'scheduled CbA'); scheduleWork(cbB); @@ -288,16 +286,16 @@

Tests:

updateTestResult(4, 'cbA called with argument of ' + JSON.stringify(x)); updateTestResult(4, 'cbA running and taking some time'); waitForTimeToPass(35); - } + }; const cbB = (x) => { updateTestResult(4, 'cbB called with argument of ' + JSON.stringify(x)); - } + }; const cbC = (x) => { updateTestResult(4, 'cbC called with argument of ' + JSON.stringify(x)); - } + }; const cbD = (x) => { updateTestResult(4, 'cbD called with argument of ' + JSON.stringify(x)); - } + }; scheduleWork(cbA); // won't time out updateTestResult(4, 'scheduled cbA'); scheduleWork(cbB, {timeout: 100}); // times out later @@ -323,24 +321,24 @@

Tests:

// When some callbacks throw errors, still calls them all within the same frame const cbA = (x) => { console.log('cbA called with argument of ' + JSON.stringify(x)); - } + }; const cbB = (x) => { console.log('cbB called with argument of ' + JSON.stringify(x)); console.log('cbB is about to throw an error!'); throw new Error('error B'); - } + }; const cbC = (x) => { console.log('cbC called with argument of ' + JSON.stringify(x)); - } + }; const cbD = (x) => { console.log('cbD called with argument of ' + JSON.stringify(x)); console.log('cbD is about to throw an error!'); throw new Error('error D'); - } + }; const cbE = (x) => { console.log('cbE called with argument of ' + JSON.stringify(x)); console.log('This was the last callback! ------------------'); - } + }; console.log('We are aiming to roughly emulate the way ' + '`requestAnimationFrame` handles errors from callbacks.'); @@ -393,7 +391,7 @@

Tests:

console.log('scheduled cbD'); scheduleWork(cbE); console.log('scheduled cbE'); - }; + } } function runTestSix() { @@ -403,22 +401,22 @@

Tests:

console.log('cbA called with argument of ' + JSON.stringify(x)); console.log('cbA is about to throw an error!'); throw new Error('error A'); - } + }; const cbB = (x) => { console.log('cbB called with argument of ' + JSON.stringify(x)); - } + }; const cbC = (x) => { console.log('cbC called with argument of ' + JSON.stringify(x)); - } + }; const cbD = (x) => { console.log('cbD called with argument of ' + JSON.stringify(x)); console.log('cbD is about to throw an error!'); throw new Error('error D'); - } + }; const cbE = (x) => { console.log('cbE called with argument of ' + JSON.stringify(x)); console.log('This was the last callback! ------------------'); - } + }; console.log('We are aiming to roughly emulate the way ' + '`requestAnimationFrame` handles errors from callbacks.'); @@ -471,7 +469,7 @@

Tests:

console.log('scheduled cbD'); scheduleWork(cbE, {timeout: 1}); console.log('scheduled cbE'); - }; + } } function runTestSeven() { diff --git a/packages/events/EventPluginRegistry.js b/packages/events/EventPluginRegistry.js index 77cf4429b8cb9..4e401ee94b5dd 100644 --- a/packages/events/EventPluginRegistry.js +++ b/packages/events/EventPluginRegistry.js @@ -78,7 +78,8 @@ function recomputePluginOrdering(): void { * Publishes an event so that it can be dispatched by the supplied plugin. * * @param {object} dispatchConfig Dispatch configuration for the event. - * @param {object} PluginModule Plugin publishing the event. + * @param {object} pluginModule Plugin publishing the event. + * @param {string} eventName name of event. * @return {boolean} True if the event was successfully published. * @private */ @@ -123,7 +124,8 @@ function publishEventForPlugin( * Publishes a registration name that is used to identify dispatched events. * * @param {string} registrationName Registration name to add. - * @param {object} PluginModule Plugin publishing the event. + * @param {object} pluginModule Plugin publishing the event. + * @param {string} eventName name of event. * @private */ function publishRegistrationName( @@ -191,7 +193,7 @@ export const possibleRegistrationNames = __DEV__ ? {} : (null: any); * to be decoupled from injection of the actual plugins so that ordering is * always deterministic regardless of packaging, on-the-fly injection, etc. * - * @param {array} InjectedEventPluginOrder + * @param {array} injectedEventPluginOrder * @internal * @see {EventPluginHub.injection.injectEventPluginOrder} */ diff --git a/packages/events/ResponderEventPlugin.js b/packages/events/ResponderEventPlugin.js index f8acb05f5b70a..19cd1f229da4b 100644 --- a/packages/events/ResponderEventPlugin.js +++ b/packages/events/ResponderEventPlugin.js @@ -245,9 +245,9 @@ to return true:wantsResponderID| | +-----------v-------------+true| +------------------------+ | |onMoveShouldSetResponder |----->|onResponderMove (cur) |<-----------+ +-----------+-------------+ | +------------------------+ | | - | | | +--------+-------+ - | returned true for| false:REJECT +-------->|onResponderRejec| - | wantsResponderID | | | +----------------+ + | | | +--------+--------+ + | returned true for| false:REJECT +-------->|onResponderReject| + | wantsResponderID | | | +-----------------+ | (now attempt | +------------------+-----+ | | handoff) | | onResponder | | +------------------->| TerminationRequest| | From 5e2146875c6a99f70cb993225fc8fae109c4fc07 Mon Sep 17 00:00:00 2001 From: seunggabi Date: Sat, 1 Sep 2018 14:09:53 +0900 Subject: [PATCH 2/2] refact: remove unused variable --- fixtures/schedule/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fixtures/schedule/index.html b/fixtures/schedule/index.html index c2d358ea2055f..1366ee1c0b7dd 100644 --- a/fixtures/schedule/index.html +++ b/fixtures/schedule/index.html @@ -92,7 +92,7 @@

Tests: