You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by da...@apache.org on 2017/08/17 03:59:29 UTC

[12/43] incubator-weex git commit: * [jsfm] modify the file path in test

* [jsfm] modify the file path in test


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

Branch: refs/heads/0.16-dev
Commit: 2f7921ece78bdf60ff419b7c0973b359599f16cb
Parents: 0729ac5
Author: Hanks <zh...@gmail.com>
Authored: Mon Aug 7 15:58:39 2017 +0800
Committer: Hanks <zh...@gmail.com>
Committed: Mon Aug 7 15:58:39 2017 +0800

----------------------------------------------------------------------
 html5/runtime/bridge/normalize.js        | 25 +------------------------
 html5/runtime/utils.js                   | 23 +++++++++++++++++++++++
 html5/test/case/prepare.js               |  4 ++--
 html5/test/unit/default/app/bundle.js    |  2 +-
 html5/test/unit/default/runtime.js       |  2 +-
 html5/test/unit/default/vm/dom-helper.js |  2 +-
 html5/test/unit/default/vm/vm.js         |  2 +-
 html5/test/unit/vdom/directive.js        |  2 +-
 html5/test/unit/vdom/listener.js         |  2 +-
 9 files changed, 32 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2f7921ec/html5/runtime/bridge/normalize.js
----------------------------------------------------------------------
diff --git a/html5/runtime/bridge/normalize.js b/html5/runtime/bridge/normalize.js
index 486167d..5cdc08a 100644
--- a/html5/runtime/bridge/normalize.js
+++ b/html5/runtime/bridge/normalize.js
@@ -1,27 +1,4 @@
-import { typof } from '../utils'
-
-export function bufferToBase64 (buffer) {
-  if (typeof btoa !== 'function') {
-    return ''
-  }
-  const string = Array.prototype.map.call(
-    new Uint8Array(buffer),
-    code => String.fromCharCode(code)
-  ).join('')
-  return btoa(string) // eslint-disable-line no-undef
-}
-
-export function base64ToBuffer (base64) {
-  if (typeof atob !== 'function') {
-    return new ArrayBuffer(0)
-  }
-  const string = atob(base64) // eslint-disable-line no-undef
-  const array = new Uint8Array(string.length)
-  Array.prototype.forEach.call(string, (ch, i) => {
-    array[i] = ch.charCodeAt(0)
-  })
-  return array.buffer
-}
+import { typof, bufferToBase64, base64ToBuffer } from '../utils'
 
 /**
  * Normalize a primitive value.

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2f7921ec/html5/runtime/utils.js
----------------------------------------------------------------------
diff --git a/html5/runtime/utils.js b/html5/runtime/utils.js
index e91e354..f96703a 100644
--- a/html5/runtime/utils.js
+++ b/html5/runtime/utils.js
@@ -11,3 +11,26 @@ export function typof (v) {
   const s = Object.prototype.toString.call(v)
   return s.substring(8, s.length - 1)
 }
+
+export function bufferToBase64 (buffer) {
+  if (typeof btoa !== 'function') {
+    return ''
+  }
+  const string = Array.prototype.map.call(
+    new Uint8Array(buffer),
+    code => String.fromCharCode(code)
+  ).join('')
+  return btoa(string) // eslint-disable-line no-undef
+}
+
+export function base64ToBuffer (base64) {
+  if (typeof atob !== 'function') {
+    return new ArrayBuffer(0)
+  }
+  const string = atob(base64) // eslint-disable-line no-undef
+  const array = new Uint8Array(string.length)
+  Array.prototype.forEach.call(string, (ch, i) => {
+    array[i] = ch.charCodeAt(0)
+  })
+  return array.buffer
+}

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2f7921ec/html5/test/case/prepare.js
----------------------------------------------------------------------
diff --git a/html5/test/case/prepare.js b/html5/test/case/prepare.js
index 6532c87..d787c42 100644
--- a/html5/test/case/prepare.js
+++ b/html5/test/case/prepare.js
@@ -28,8 +28,8 @@ import {
 // load env
 import shared from '../../shared'
 import { Document, Element, Comment } from '../../runtime/vdom'
-import Listener from '../../runtime/listener'
-import { TaskCenter, init } from '../../runtime/task-center'
+import Listener from '../../runtime/bridge/Listener'
+import { TaskCenter, init } from '../../runtime/bridge/TaskCenter'
 
 // load framework
 import * as defaultFramework from '../../frameworks/legacy'

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2f7921ec/html5/test/unit/default/app/bundle.js
----------------------------------------------------------------------
diff --git a/html5/test/unit/default/app/bundle.js b/html5/test/unit/default/app/bundle.js
index 799ebcb..64e860a 100644
--- a/html5/test/unit/default/app/bundle.js
+++ b/html5/test/unit/default/app/bundle.js
@@ -26,7 +26,7 @@ import * as bundle from '../../../../frameworks/legacy/app/bundle'
 import * as register from '../../../../frameworks/legacy/app/register'
 import { removeWeexPrefix } from '../../../../frameworks/legacy/util'
 import { Document } from '../../../../runtime/vdom'
-import Listener from '../../../../runtime/listener'
+import Listener from '../../../../runtime/bridge/Listener'
 
 describe('parsing a bundle file', () => {
   const componentTemplate = {

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2f7921ec/html5/test/unit/default/runtime.js
----------------------------------------------------------------------
diff --git a/html5/test/unit/default/runtime.js b/html5/test/unit/default/runtime.js
index 19538c7..1aa0a8c 100644
--- a/html5/test/unit/default/runtime.js
+++ b/html5/test/unit/default/runtime.js
@@ -27,7 +27,7 @@ chai.use(sinonChai)
 import runtime from '../../../runtime'
 import frameworks from '../../../frameworks'
 import defaultConfig from '../../../frameworks/legacy/config'
-import { init as resetTaskHandler } from '../../../runtime/task-center'
+import { init as resetTaskHandler } from '../../../runtime/bridge/TaskCenter'
 
 const { init, config } = runtime
 config.frameworks = frameworks

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2f7921ec/html5/test/unit/default/vm/dom-helper.js
----------------------------------------------------------------------
diff --git a/html5/test/unit/default/vm/dom-helper.js b/html5/test/unit/default/vm/dom-helper.js
index b889468..48c0a87 100644
--- a/html5/test/unit/default/vm/dom-helper.js
+++ b/html5/test/unit/default/vm/dom-helper.js
@@ -28,7 +28,7 @@ import {
   removeTarget
 } from '../../../../frameworks/legacy/vm/dom-helper'
 import { Document } from '../../../../runtime/vdom'
-import Listener from '../../../../runtime/listener'
+import Listener from '../../../../runtime/bridge/Listener'
 
 describe('help create body', () => {
   let vm

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2f7921ec/html5/test/unit/default/vm/vm.js
----------------------------------------------------------------------
diff --git a/html5/test/unit/default/vm/vm.js b/html5/test/unit/default/vm/vm.js
index b27cf3d..9010f53 100644
--- a/html5/test/unit/default/vm/vm.js
+++ b/html5/test/unit/default/vm/vm.js
@@ -24,7 +24,7 @@ chai.use(sinonChai)
 
 import Vm from '../../../../frameworks/legacy/vm'
 import { Document } from '../../../../runtime/vdom'
-import { init as resetTaskHandler } from '../../../../runtime/task-center'
+import { init as resetTaskHandler } from '../../../../runtime/bridge/TaskCenter'
 import Differ from '../../../../frameworks/legacy/app/differ'
 
 const oriCallNative = global.callNative

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2f7921ec/html5/test/unit/vdom/directive.js
----------------------------------------------------------------------
diff --git a/html5/test/unit/vdom/directive.js b/html5/test/unit/vdom/directive.js
index 5d7d037..cbe9ab1 100644
--- a/html5/test/unit/vdom/directive.js
+++ b/html5/test/unit/vdom/directive.js
@@ -52,7 +52,7 @@ describe('filterDirective', () => {
   })
 
   it('parse object', () => {
-    expect(filterDirective({ key: '[[x]]' })).to.deep.equal({ key: { '@binding': 'x' } })
+    expect(filterDirective({ key: '[[x]]' })).to.deep.equal({ key: { '@binding': 'x' }})
     expect(filterDirective({ a: '[[A]]', b: '[[B]]' })).to.deep.equal({
       a: { '@binding': 'A' },
       b: { '@binding': 'B' }

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2f7921ec/html5/test/unit/vdom/listener.js
----------------------------------------------------------------------
diff --git a/html5/test/unit/vdom/listener.js b/html5/test/unit/vdom/listener.js
index ca1d95f..d6c5e71 100644
--- a/html5/test/unit/vdom/listener.js
+++ b/html5/test/unit/vdom/listener.js
@@ -23,7 +23,7 @@ const { expect } = chai
 chai.use(sinonChai)
 
 import { Document } from '../../../runtime/vdom'
-import Listener from '../../../runtime/listener'
+import Listener from '../../../runtime/bridge/Listener'
 
 describe('dom listener basic', () => {
   it('works with no id', () => {