diff --git a/flow/compiler.js b/flow/compiler.js index 9ed21a84..5c88bc9b 100644 --- a/flow/compiler.js +++ b/flow/compiler.js @@ -1,3 +1,6 @@ +// global flag to be compiled away +declare var __WEEX__: boolean; + declare type CompilerOptions = { warn?: Function; // allow customizing warning in different environments; e.g. node expectHTML?: boolean; // only false for non-web builds diff --git a/src/compiler/codegen/events.js b/src/compiler/codegen/events.js index 4f7aa411..5e08baad 100644 --- a/src/compiler/codegen/events.js +++ b/src/compiler/codegen/events.js @@ -82,7 +82,6 @@ function genHandler ( if (isMethodPath || isFunctionExpression) { return handler.value } - // $flow-disable-line if (__WEEX__ && handler.params) { return genWeexHandler(handler.params, handler.value) } @@ -122,7 +121,6 @@ function genHandler ( : isFunctionExpression ? `(${handler.value})($event)` : handler.value - // $flow-disable-line if (__WEEX__ && handler.params) { return genWeexHandler(handler.params, code + handlerCode) } diff --git a/src/core/vdom/create-component.js b/src/core/vdom/create-component.js index 3356b2aa..e93840cb 100644 --- a/src/core/vdom/create-component.js +++ b/src/core/vdom/create-component.js @@ -148,7 +148,6 @@ export function createComponent ( // template. This is essentially inline expanding instead of creating // an actual instance. // https://github.com/Hanks10100/weex-native-directive/tree/master/component - // $flow-disable-line if (__WEEX__ && data.attrs && data.attrs['@isInRecycleList']) { const altRender = Ctor.options['@render'] if (altRender) { diff --git a/src/core/vdom/helpers/update-listeners.js b/src/core/vdom/helpers/update-listeners.js index 4ec3bf20..ca1c7c4c 100644 --- a/src/core/vdom/helpers/update-listeners.js +++ b/src/core/vdom/helpers/update-listeners.js @@ -54,7 +54,6 @@ export function updateListeners ( def = cur = on[name] old = oldOn[name] event = normalizeEvent(name) - // $flow-disable-line if (__WEEX__ && isPlainObject(def)) { cur = def.handler event.params = def.params