Skip to content

Commit 531371b

Browse files
committed
types: upgrade flow
1 parent 4e00688 commit 531371b

File tree

13 files changed

+30
-29
lines changed

13 files changed

+30
-29
lines changed

flow/compiler.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -173,21 +173,13 @@ declare type SFCDescriptor = {
173173
template: ?SFCBlock;
174174
script: ?SFCBlock;
175175
styles: Array<SFCBlock>;
176-
customBlocks: Array<SFCCustomBlock>;
177-
}
178-
179-
declare type SFCCustomBlock = {
180-
type: string;
181-
content: string;
182-
start?: number;
183-
end?: number;
184-
src?: string;
185-
attrs: {[attribute:string]: string};
176+
customBlocks: Array<SFCBlock>;
186177
};
187178

188179
declare type SFCBlock = {
189180
type: string;
190181
content: string;
182+
attrs: {[attribute:string]: string};
191183
start?: number;
192184
end?: number;
193185
lang?: string;

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
"eslint-plugin-jasmine": "^2.8.4",
8686
"eslint-plugin-vue-libs": "^2.0.1",
8787
"file-loader": "^1.1.5",
88-
"flow-bin": "^0.54.0",
88+
"flow-bin": "^0.61.0",
8989
"hash-sum": "^1.0.2",
9090
"he": "^1.1.1",
9191
"http-server": "^0.10.0",

src/compiler/create-compiler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export function createCompilerCreator (baseCompile: Function): Function {
2626
// merge custom directives
2727
if (options.directives) {
2828
finalOptions.directives = extend(
29-
Object.create(baseOptions.directives),
29+
Object.create(baseOptions.directives || null),
3030
options.directives
3131
)
3232
}

src/compiler/to-function.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ function createFunction (code, errors) {
1818
}
1919

2020
export function createCompileToFunctionFn (compile: Function): Function {
21-
const cache: {
22-
[key: string]: CompiledFunctionResult;
23-
} = Object.create(null)
21+
const cache = Object.create(null)
2422

2523
return function compileToFunctions (
2624
template: string,

src/core/config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export default ({
3636
/**
3737
* Option merge strategies (used in core/util/options)
3838
*/
39+
// $flow-disable-line
3940
optionMergeStrategies: Object.create(null),
4041

4142
/**
@@ -76,6 +77,7 @@ export default ({
7677
/**
7778
* Custom user key aliases for v-on
7879
*/
80+
// $flow-disable-line
7981
keyCodes: Object.create(null),
8082

8183
/**

src/core/instance/lifecycle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ export function updateChildComponent (
212212
vm: Component,
213213
propsData: ?Object,
214214
listeners: ?Object,
215-
parentVnode: VNode,
215+
parentVnode: MountedComponentVNode,
216216
renderChildren: ?Array<VNode>
217217
) {
218218
if (process.env.NODE_ENV !== 'production') {

src/core/instance/render-helpers/resolve-slots.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/* @flow */
22

3+
import type VNode from 'core/vdom/vnode'
4+
35
/**
46
* Runtime helper for resolving raw children VNodes into a slot object.
57
*/
@@ -23,10 +25,10 @@ export function resolveSlots (
2325
if ((child.context === context || child.fnContext === context) &&
2426
data && data.slot != null
2527
) {
26-
const name = child.data.slot
28+
const name = data.slot
2729
const slot = (slots[name] || (slots[name] = []))
2830
if (child.tag === 'template') {
29-
slot.push.apply(slot, child.children)
31+
slot.push.apply(slot, child.children || [])
3032
} else {
3133
slot.push(child)
3234
}

src/core/instance/state.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ function getData (data: Function, vm: Component): any {
161161
const computedWatcherOptions = { lazy: true }
162162

163163
function initComputed (vm: Component, computed: Object) {
164+
// $flow-disable-line
164165
const watchers = vm._computedWatchers = Object.create(null)
165166
// computed properties are just getters during SSR
166167
const isSSR = isServerRendering()

src/core/vdom/modules/directives.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,17 +86,20 @@ function normalizeDirectives (
8686
): { [key: string]: VNodeDirective } {
8787
const res = Object.create(null)
8888
if (!dirs) {
89+
// $flow-disable-line
8990
return res
9091
}
9192
let i, dir
9293
for (i = 0; i < dirs.length; i++) {
9394
dir = dirs[i]
9495
if (!dir.modifiers) {
96+
// $flow-disable-line
9597
dir.modifiers = emptyModifiers
9698
}
9799
res[getRawDirName(dir)] = dir
98100
dir.def = resolveAsset(vm.$options, 'directives', dir.name, true)
99101
}
102+
// $flow-disable-line
100103
return res
101104
}
102105

0 commit comments

Comments
 (0)