Skip to content

Fixed typo and jsdoc #13528

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 22 additions & 23 deletions fixtures/scheduler/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ <h2>Tests:</h2>
<script src="https://unpkg.com/babel-standalone@6/babel.js"></script>
<script type="text/babel">
const {
unstable_scheduleWork: scheduleWork,
unstable_scheduleCallback: scheduleCallback,
unstable_cancelCallback: cancelCallback,
unstable_now: now
Expand All @@ -113,7 +114,7 @@ <h2>Tests:</h2>
}
function updateTestResult(testNumber, textToAddToResult) {
latestResults[testNumber - 1].push(textToAddToResult);
};
}
function checkTestResult(testNumber) {

let correct = true;
Expand Down Expand Up @@ -220,18 +221,16 @@ <h2>Tests:</h2>
// 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
Expand Down Expand Up @@ -265,10 +264,10 @@ <h2>Tests:</h2>
}
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);
Expand All @@ -295,16 +294,16 @@ <h2>Tests:</h2>
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
Expand All @@ -330,24 +329,24 @@ <h2>Tests:</h2>
// 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.');
Expand Down Expand Up @@ -400,7 +399,7 @@ <h2>Tests:</h2>
console.log('scheduled cbD');
scheduleWork(cbE);
console.log('scheduled cbE');
};
}
}

function runTestSix() {
Expand All @@ -410,22 +409,22 @@ <h2>Tests:</h2>
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.');
Expand Down Expand Up @@ -478,7 +477,7 @@ <h2>Tests:</h2>
console.log('scheduled cbD');
scheduleWork(cbE, {timeout: 1});
console.log('scheduled cbE');
};
}
}

function runTestSeven() {
Expand Down
8 changes: 5 additions & 3 deletions packages/events/EventPluginRegistry.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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}
*/
Expand Down
6 changes: 3 additions & 3 deletions packages/events/ResponderEventPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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| |
Expand Down