You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by fk...@apache.org on 2017/04/12 08:27:55 UTC

[12/17] incubator-weex git commit: * [html5] fix lint.

* [html5] fix lint.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/8e6d31d9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/8e6d31d9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/8e6d31d9

Branch: refs/heads/0.11-dev
Commit: 8e6d31d9d9c51cb6bfa81347bf0a8f3436dd4263
Parents: ff76bfa
Author: MrRaindrop <te...@gmail.com>
Authored: Mon Apr 10 16:12:20 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Mon Apr 10 16:12:20 2017 +0800

----------------------------------------------------------------------
 .eslintignore                                   |  1 +
 .../vue/components/scrollable/list/style.js     |  2 +-
 html5/test/render/vue/core/scope-style-map.js   |  2 --
 html5/test/render/vue/core/style.js             | 35 ++++++++------------
 html5/test/render/vue/helper/index.js           | 35 +-------------------
 html5/test/render/vue/helper/runtime.js         | 11 ++----
 html5/test/render/vue/utils/func.js             |  1 -
 html5/test/render/vue/utils/style.js            | 10 +++---
 8 files changed, 24 insertions(+), 73 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/8e6d31d9/.eslintignore
----------------------------------------------------------------------
diff --git a/.eslintignore b/.eslintignore
index ebc4e43..60ec529 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -2,6 +2,7 @@
 html5/test/case/*/*.source.js
 html5/test/case/*/*.output.js
 html5/test/render/vue/vender/*
+html5/test/render/vue/data/*
 *.css
 doc/themes/weex/source/*/*.js
 doc/themes/weex/source/*/*/*.js

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/8e6d31d9/html5/render/vue/components/scrollable/list/style.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/scrollable/list/style.js b/html5/render/vue/components/scrollable/list/style.js
index c9122af..8db6b4c 100644
--- a/html5/render/vue/components/scrollable/list/style.js
+++ b/html5/render/vue/components/scrollable/list/style.js
@@ -13,4 +13,4 @@ body > .weex-list {
   -webkit-overflow-scrolling: touch;
   width: 100%;
 }
-`
\ No newline at end of file
+`

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/8e6d31d9/html5/test/render/vue/core/scope-style-map.js
----------------------------------------------------------------------
diff --git a/html5/test/render/vue/core/scope-style-map.js b/html5/test/render/vue/core/scope-style-map.js
index 8968687..af3002c 100644
--- a/html5/test/render/vue/core/scope-style-map.js
+++ b/html5/test/render/vue/core/scope-style-map.js
@@ -25,7 +25,6 @@ function getStyleSheetNodes () {
 }
 
 describe('style map', () => {
-
   let styleSheetNodes
 
   before(function () {
@@ -56,7 +55,6 @@ describe('style map', () => {
     for (const key in headMap) {
       const expected = headMap[key]
       const result = styleMap[key]
-      debugger;
       expect(expected).be.deep.equal(result)
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/8e6d31d9/html5/test/render/vue/core/style.js
----------------------------------------------------------------------
diff --git a/html5/test/render/vue/core/style.js b/html5/test/render/vue/core/style.js
index 6b4a5ae..e0cdc65 100644
--- a/html5/test/render/vue/core/style.js
+++ b/html5/test/render/vue/core/style.js
@@ -1,33 +1,26 @@
 import { init } from '../helper/runtime'
-import {
-  getScopeIds,
-  getScopeStyle,
-  getComponentStyle,
-  getSize
-} from '../../../../render/vue/core/style'
 import div from '../../../../render/vue/components/div'
 import image from '../../../../render/vue/components/image'
-import { init as initViewport, resetViewport } from '../../../../render/vue/env/viewport'
+import { init as initViewport } from '../../../../render/vue/env/viewport'
 
 import scopedStyleBundle from '../data/build/dotvue/scoped-style'
 
-function toArray (arr) {
-  return Array.prototype.slice.call(arr)
-}
+// function toArray (arr) {
+//   return Array.prototype.slice.call(arr)
+// }
 
-function getVStyleSheetNodes () {
-  const regVStyleSheets = /((?:,?\s*\.[\w-]+\[data-v-\w+\](?::\w+)?)+)\s*({[^}]+)/
-  const nodes = toArray(document.styleSheets)
-    .filter(function (styleSheet) {
-      return regVStyleSheets.test(styleSheet.ownerNode.textContent)
-    }).map(function (styleSheet) {
-      return styleSheet.ownerNode
-    })
-  return nodes
-}
+// function getVStyleSheetNodes () {
+//   const regVStyleSheets = /((?:,?\s*\.[\w-]+\[data-v-\w+\](?::\w+)?)+)\s*({[^}]+)/
+//   const nodes = toArray(document.styleSheets)
+//     .filter(function (styleSheet) {
+//       return regVStyleSheets.test(styleSheet.ownerNode.textContent)
+//     }).map(function (styleSheet) {
+//       return styleSheet.ownerNode
+//     })
+//   return nodes
+// }
 
 init('core style', (Vue, helper) => {
-  const { compile, utils } = helper
   const { scale } = initViewport()
   before(() => {
     helper.register('div', div)

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/8e6d31d9/html5/test/render/vue/helper/index.js
----------------------------------------------------------------------
diff --git a/html5/test/render/vue/helper/index.js b/html5/test/render/vue/helper/index.js
index 90e7371..75a1976 100644
--- a/html5/test/render/vue/helper/index.js
+++ b/html5/test/render/vue/helper/index.js
@@ -14,7 +14,7 @@ import * as utils from './utils'
  */
 export function init (title, fn) {
   return describe(title, () => {
-    let components = {}
+    // let components = {}
 
     before(function () {
       const htmlRegex = /^html:/i
@@ -71,36 +71,3 @@ export function init (title, fn) {
     })
   })
 }
-
-// import vue200 from './vender/vue-2.0.0.js'
-// import vue210 from './vender/vue-2.1.0.js'
-// const Vues = [
-//   vue200,
-//   vue210
-// ]
-/**
- * Describe tests for multiple versions of Vue.
- */
-// export function multiDescribe (title, fn) {
-//   return describe(title, () => {
-//     Vues.forEach(Vue => {
-//       let components = {}
-//       Vue.config.isReservedTag = function () { return false }
-//       describe(`Vue ${Vue.version}`, () => fn(Vue, {
-//         register (name, component) {
-//           components[name] = component
-//         },
-//         reset () {
-//           components = {}
-//         },
-//         createVm (options = {}) {
-//           options.components = components
-//           return new Vue(options).$mount()
-//         },
-//         compile (template) {
-//           return this.createVm({ template })
-//         }
-//       }))
-//     })
-//   })
-// }

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/8e6d31d9/html5/test/render/vue/helper/runtime.js
----------------------------------------------------------------------
diff --git a/html5/test/render/vue/helper/runtime.js b/html5/test/render/vue/helper/runtime.js
index 140405a..522b132 100644
--- a/html5/test/render/vue/helper/runtime.js
+++ b/html5/test/render/vue/helper/runtime.js
@@ -14,7 +14,7 @@ import * as utils from './utils'
  */
 export function init (title, fn) {
   return describe(title, () => {
-    let components = {}
+    // let components = {}
 
     before(function () {
       const htmlRegex = /^html:/i
@@ -41,17 +41,10 @@ export function init (title, fn) {
        */
       register (name, component) {
         global.weex.registerComponent(name, component)
-        components[name] = component
+        // components[name] = component
       },
 
       /**
-       * reset registered components with empty object.
-       */
-      // reset () {
-      //   components = {}
-      // },
-
-      /**
        * create a vm instance of Vue.
        * @param  {Object} options.
        * @return {Vue} vue instance.

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/8e6d31d9/html5/test/render/vue/utils/func.js
----------------------------------------------------------------------
diff --git a/html5/test/render/vue/utils/func.js b/html5/test/render/vue/utils/func.js
index 17341f6..0aaa151 100644
--- a/html5/test/render/vue/utils/func.js
+++ b/html5/test/render/vue/utils/func.js
@@ -46,5 +46,4 @@ describe('utils', function () {
       expect(abc).to.deep.equal({ name: 'x' })
     })
   })
-
 })

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/8e6d31d9/html5/test/render/vue/utils/style.js
----------------------------------------------------------------------
diff --git a/html5/test/render/vue/utils/style.js b/html5/test/render/vue/utils/style.js
index af0d71a..77b85ac 100644
--- a/html5/test/render/vue/utils/style.js
+++ b/html5/test/render/vue/utils/style.js
@@ -1,15 +1,15 @@
 import {
   autoPrefix,
-  normalizeStyle,
+  // normalizeStyle,
   normalizeString,
   normalizeNumber,
   normalizeUnitsNum
 } from '../../../../render/vue/utils/style'
-import { init, resetViewport } from '../../../../render/vue/env/viewport'
+import { init } from '../../../../render/vue/env/viewport'
 
 describe('style', function () {
-  const rect = document.documentElement.getBoundingClientRect()
-  const info = {}
+  // const rect = document.documentElement.getBoundingClientRect()
+  // const info = {}
   const { scale, dpr } = init()
 
   it('should normalize units numbers', function () {
@@ -65,4 +65,4 @@ describe('autoPrefix', function () {
     expect(transform).to.equal('translate3d(100px, 100px, 0)')
     expect(width).to.equal('200px')
   })
-})
\ No newline at end of file
+})