Skip to content
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

Fixed misc function arity issues #9816

Merged
merged 1 commit into from
May 30, 2017
Merged
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
4 changes: 2 additions & 2 deletions src/renderers/shared/fiber/ReactChildFiber.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ if (__DEV__) {
'Each child in an array or iterator should have a unique ' +
'"key" prop. See https://fb.me/react-warning-keys for ' +
'more information.' +
(getCurrentFiberStackAddendum(child) || '');
(getCurrentFiberStackAddendum() || '');
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
return;
}
Expand All @@ -70,7 +70,7 @@ if (__DEV__) {
'Each child in an array or iterator should have a unique ' +
'"key" prop. See https://fb.me/react-warning-keys for ' +
'more information.%s',
getCurrentFiberStackAddendum(child),
getCurrentFiberStackAddendum(),
);
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/renderers/shared/fiber/ReactFiberErrorLogger.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const invariant = require('fbjs/lib/invariant');

import type {CapturedError} from 'ReactFiberScheduler';

const defaultShowDialog = () => true;
const defaultShowDialog = (capturedError: CapturedError) => true;

let showDialog = defaultShowDialog;

Expand Down
2 changes: 1 addition & 1 deletion src/renderers/shared/fiber/ReactFiberReconciler.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type OpaqueRoot = FiberRoot;

export type HostConfig<T, P, I, TI, PI, C, CX, PL> = {
getRootHostContext(rootContainerInstance: C): CX,
getChildHostContext(parentHostContext: CX, type: T): CX,
getChildHostContext(parentHostContext: CX, type: T, instance: C): CX,
getPublicInstance(instance: I | TI): PI,

createInstance(
Expand Down
22 changes: 6 additions & 16 deletions src/renderers/shared/fiber/ReactFiberScheduler.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
firstEffect = finishedWork.firstEffect;
}

const commitInfo = prepareForCommit();
prepareForCommit();

// Commit all the side-effects within a tree. We'll do this in two passes.
// The first pass performs all the host insertions, updates, deletions and
Expand All @@ -474,15 +474,10 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
while (nextEffect !== null) {
let error = null;
if (__DEV__) {
error = invokeGuardedCallback(
null,
commitAllHostEffects,
null,
finishedWork,
);
error = invokeGuardedCallback(null, commitAllHostEffects, null);
} else {
try {
commitAllHostEffects(finishedWork);
commitAllHostEffects();
} catch (e) {
error = e;
}
Expand All @@ -504,7 +499,7 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
stopCommitHostEffectsTimer();
}

resetAfterCommit(commitInfo);
resetAfterCommit();

// The work-in-progress tree is now the current tree. This must come after
// the first pass of the commit phase, so that the previous tree is still
Expand All @@ -523,15 +518,10 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
while (nextEffect !== null) {
let error = null;
if (__DEV__) {
error = invokeGuardedCallback(
null,
commitAllLifeCycles,
null,
finishedWork,
);
error = invokeGuardedCallback(null, commitAllLifeCycles, null);
} else {
try {
commitAllLifeCycles(finishedWork);
commitAllLifeCycles();
} catch (e) {
error = e;
}
Expand Down
6 changes: 3 additions & 3 deletions src/renderers/shared/stack/reconciler/CallbackQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ var validateCallback = require('validateCallback');
* @implements PooledClass
* @internal
*/
class CallbackQueue<T> {
_callbacks: ?Array<() => void>;
class CallbackQueue<T, Targ> {
_callbacks: ?Array<(arg: Targ) => void>;
_contexts: ?Array<T>;
_arg: ?mixed;
_arg: Targ;

constructor(arg) {
this._callbacks = null;
Expand Down
6 changes: 4 additions & 2 deletions src/shared/utils/PooledClass.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,10 @@ var addPoolingTo = function<T>(
CopyConstructor: Class<T>,
pooler: Pooler,
): Class<T> & {
getPooled(): /* arguments of the constructor */ T,
release(): void,
getPooled(
...args: $ReadOnlyArray<mixed>
): /* arguments of the constructor */ T,
release(instance: mixed): void,
} {
// Casting as any so that flow ignores the actual implementation and trusts
// it to match the type we declared
Expand Down