Skip to content

Commit 8134095

Browse files
committed
refactor(weex): declare __WEEX__ in flow typings
1 parent 46c8016 commit 8134095

File tree

4 files changed

+3
-4
lines changed

4 files changed

+3
-4
lines changed

Diff for: flow/compiler.js

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// global flag to be compiled away
2+
declare var __WEEX__: boolean;
3+
14
declare type CompilerOptions = {
25
warn?: Function; // allow customizing warning in different environments; e.g. node
36
expectHTML?: boolean; // only false for non-web builds

Diff for: src/compiler/codegen/events.js

-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ function genHandler (
8282
if (isMethodPath || isFunctionExpression) {
8383
return handler.value
8484
}
85-
// $flow-disable-line
8685
if (__WEEX__ && handler.params) {
8786
return genWeexHandler(handler.params, handler.value)
8887
}
@@ -122,7 +121,6 @@ function genHandler (
122121
: isFunctionExpression
123122
? `(${handler.value})($event)`
124123
: handler.value
125-
// $flow-disable-line
126124
if (__WEEX__ && handler.params) {
127125
return genWeexHandler(handler.params, code + handlerCode)
128126
}

Diff for: src/core/vdom/create-component.js

-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ export function createComponent (
148148
// template. This is essentially inline expanding instead of creating
149149
// an actual instance.
150150
// https://github.com/Hanks10100/weex-native-directive/tree/master/component
151-
// $flow-disable-line
152151
if (__WEEX__ && data.attrs && data.attrs['@isInRecycleList']) {
153152
const altRender = Ctor.options['@render']
154153
if (altRender) {

Diff for: src/core/vdom/helpers/update-listeners.js

-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ export function updateListeners (
5454
def = cur = on[name]
5555
old = oldOn[name]
5656
event = normalizeEvent(name)
57-
// $flow-disable-line
5857
if (__WEEX__ && isPlainObject(def)) {
5958
cur = def.handler
6059
event.params = def.params

0 commit comments

Comments
 (0)