Просмотр исходного кода

refactor(weex): declare __WEEX__ in flow typings

Evan You 8 лет назад
Родитель
Сommit
813409593e

+ 3 - 0
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

+ 0 - 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)
     }

+ 0 - 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) {

+ 0 - 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