weex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acton...@apache.org
Subject [13/39] incubator-weex git commit: + [jsfm] add warnings for legacy api on prototype
Date Tue, 08 Aug 2017 08:55:25 GMT
+ [jsfm] add warnings for legacy api on prototype


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

Branch: refs/heads/0.16-dev
Commit: afc261ec042ef39eba8b41deeec5a8294e046084
Parents: d7537b2
Author: Hanks <zhanghan.me@gmail.com>
Authored: Fri Jul 28 15:35:22 2017 +0800
Committer: Hanks <zhanghan.me@gmail.com>
Committed: Fri Jul 28 15:35:22 2017 +0800

----------------------------------------------------------------------
 html5/frameworks/legacy/core/array.js   | 4 ++++
 html5/frameworks/legacy/core/object.js  | 6 ++++++
 html5/frameworks/legacy/vm/directive.js | 1 -
 3 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/afc261ec/html5/frameworks/legacy/core/array.js
----------------------------------------------------------------------
diff --git a/html5/frameworks/legacy/core/array.js b/html5/frameworks/legacy/core/array.js
index 818fdb5..856792f 100644
--- a/html5/frameworks/legacy/core/array.js
+++ b/html5/frameworks/legacy/core/array.js
@@ -64,6 +64,8 @@ def(
   arrayProto,
   '$set',
   function $set (index, val) {
+    console.warn(`[JS Framework] "Array.prototype.$set" is not a standard API,`
+      + ` it will be removed in the next version.`)
     if (index >= this.length) {
       this.length = index + 1
     }
@@ -82,6 +84,8 @@ def(
   arrayProto,
   '$remove',
   function $remove (index) {
+    console.warn(`[JS Framework] "Array.prototype.$remove" is not a standard API,`
+      + ` it will be removed in the next version.`)
     /* istanbul ignore if */
     if (!this.length) return
     /* istanbul ignore else */

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/afc261ec/html5/frameworks/legacy/core/object.js
----------------------------------------------------------------------
diff --git a/html5/frameworks/legacy/core/object.js b/html5/frameworks/legacy/core/object.js
index 4f2b5a0..86f83e3 100644
--- a/html5/frameworks/legacy/core/object.js
+++ b/html5/frameworks/legacy/core/object.js
@@ -17,6 +17,8 @@ _.define(
   objProto,
   '$add',
   function $add (key, val) {
+    console.warn(`[JS Framework] "Object.prototype.$add" is not a standard API,`
+      + ` it will be removed in the next version.`)
     if (this.hasOwnProperty(key)) return
     var ob = this.__ob__
     if (!ob || _.isReserved(key)) {
@@ -49,6 +51,8 @@ _.define(
   objProto,
   '$set',
   function $set (key, val) {
+    console.warn(`[JS Framework] "Object.prototype.$set" is not a standard API,`
+      + ` it will be removed in the next version.`)
     this.$add(key, val)
     this[key] = val
   }
@@ -66,6 +70,8 @@ _.define(
   objProto,
   '$delete',
   function $delete (key) {
+    console.warn(`[JS Framework] "Object.prototype.$delete" is not a standard API,`
+      + ` it will be removed in the next version.`)
     if (!this.hasOwnProperty(key)) return
     delete this[key]
     var ob = this.__ob__

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/afc261ec/html5/frameworks/legacy/vm/directive.js
----------------------------------------------------------------------
diff --git a/html5/frameworks/legacy/vm/directive.js b/html5/frameworks/legacy/vm/directive.js
index fec7252..081a014 100644
--- a/html5/frameworks/legacy/vm/directive.js
+++ b/html5/frameworks/legacy/vm/directive.js
@@ -259,7 +259,6 @@ function setClass (vm, el, classList) {
   if (typeof classList !== 'function' && !Array.isArray(classList)) {
     return
   }
-  console.log(` => setClass:`, classList)
   if (Array.isArray(classList) && !classList.length) {
     el.setClassStyle({})
     return


Mime
View raw message