Browse Source

refactor(weex): declare __WEEX__ in flow typings

dev
Evan You 7 years ago
parent
commit
813409593e
  1. 3
      flow/compiler.js
  2. 2
      src/compiler/codegen/events.js
  3. 1
      src/core/vdom/create-component.js
  4. 1
      src/core/vdom/helpers/update-listeners.js

3
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

2
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)
}

1
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) {

1
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

Loading…
Cancel
Save