Skip to content
This repository was archived by the owner on Dec 25, 2017. It is now read-only.

Commit f3acdd3

Browse files
committed
👕 refactor(flowtype): fix flow typings [ci skip]
1 parent 099f787 commit f3acdd3

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed

decls/component.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ declare interface Component {
6666
namespace?: string
6767
) => VNode;
6868

69-
/*
70-
* NOTE: should not be published internal interface ...
71-
*
7269
// private properties
7370
_uid: number;
7471
_isVue: true;
@@ -131,7 +128,6 @@ declare interface Component {
131128
_b: (vnode: VNodeWithData, value: any) => void;
132129
// retrive custom keyCode
133130
_k: (key: string) => ?number;
134-
*/
135131

136132
// allow dynamic method registration
137133
[key: string]: any

decls/validator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ declare interface ValidityElement {
7676
listenInputableEvent (): void,
7777
unlistenInputableEvent (): void,
7878
fireInputableEvent (): void,
79-
modelValueEqual (): ?boolean
79+
modelValueEqual (vnode: VNode): ?boolean
8080
}
8181

8282
declare type $ValidityGroupResult = Dictionary<ValidationResult>

src/components/validity/methods-event.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default function (Vue: GlobalAPI): Object {
2121

2222
const { type, orgListeners, listeners } = getEventSources(child)
2323
const modelHandler: Function = Array.isArray(orgListeners) ? orgListeners[0] : orgListeners
24-
const userHandler: Function = Array.isArray(orgListeners) ? orgListeners[1] : null
24+
const userHandler: ?Function = Array.isArray(orgListeners) ? orgListeners[1] : null
2525

2626
let integrationMode = this._modelIntegrationMode
2727
if (modelHandler && userHandler) {
@@ -50,21 +50,21 @@ export default function (Vue: GlobalAPI): Object {
5050
const event: any = args[0]
5151
if (event[MODEL_NOTIFY_EVENT] === 'DOM') {
5252
delete event[MODEL_NOTIFY_EVENT]
53-
userHandler.apply(child.context, args)
53+
userHandler && userHandler.apply(child.context, args)
5454
return
5555
} else if (event[MODEL_NOTIFY_EVENT] === 'COMPONENT') {
5656
const value: any = event.value
5757
args[0] = value
58-
userHandler.apply(child.context, args)
58+
userHandler && userHandler.apply(child.context, args)
5959
return
6060
}
6161

6262
if (modifier) {
6363
const fn = validity._applyer = modelApplyer(args)
6464
args.push(fn)
65-
userHandler.apply(child.context, args)
65+
userHandler && userHandler.apply(child.context, args)
6666
} else {
67-
userHandler.apply(child.context, args)
67+
userHandler && userHandler.apply(child.context, args)
6868
modelHandler.apply(child.context, args)
6969
}
7070
} else if (integrationMode === 'MODEL') {

src/group.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default function (Vue: GlobalAPI): Object {
3131
this._validityKeys.forEach((key: string) => {
3232
ret[key] = results[key]
3333
if (ret[key].errors) {
34-
const errors = ret.errors || []
34+
const errors: any = ret.errors || []
3535
ret[key].errors.forEach(error => {
3636
errors.push(error)
3737
})

0 commit comments

Comments
 (0)