diff --git a/src/js/anot-touch.js b/src/js/anot-touch.js index 347659c..cb2d25a 100644 --- a/src/js/anot-touch.js +++ b/src/js/anot-touch.js @@ -92,14 +92,7 @@ const _Anot = (function() { function generateID(mark) { mark = (mark && mark + '-') || 'anot-' - return ( - mark + - Math.random() - .toString(16) - .slice(-4) + - '-' + - ++bindingID - ) + return mark + (++bindingID).toString(16) } var Anot = function(el) { @@ -2108,7 +2101,7 @@ const _Anot = (function() { function createTrack(n) { var ret = [] for (var i = 0; i < n; i++) { - ret[i] = generateID('$proxy$each') + ret[i] = generateID('proxy-each') } return ret } @@ -3070,7 +3063,7 @@ const _Anot = (function() { return ret } - var rproxy = /(\$proxy\$[a-z]+)\-[\-0-9a-f]+$/ + var rproxy = /(proxy\-[a-z]+)\-[\-0-9a-f]+$/ var variablePool = new Cache(218) //缓存求值函数,以便多次利用 var evaluatorPool = new Cache(128) @@ -3366,7 +3359,7 @@ const _Anot = (function() { if (camelizeName.indexOf('@') === 0) { camelizeName = camelizeName.slice(1) attr.value = attr.value.replace(/\(.*\)$/, '') - if (vm.$id.slice(0, 11) === '$proxy$each') { + if (vm.$id.slice(0, 10) === 'proxy-each') { vm = vm.$up } if ( @@ -5950,7 +5943,7 @@ const _Anot = (function() { force: force } ) - proxy.$id = generateID('$proxy$each') + proxy.$id = generateID('proxy-each') return proxy } @@ -5983,7 +5976,7 @@ const _Anot = (function() { force: force } ) - proxy.$id = generateID('$proxy$with') + proxy.$id = generateID('proxy-with') return proxy } @@ -5991,7 +5984,7 @@ const _Anot = (function() { var proxy = cache[key] if (proxy) { var proxyPool = - proxy.$id.indexOf('$proxy$each') === 0 ? eachProxyPool : withProxyPool + proxy.$id.indexOf('proxy-each') === 0 ? eachProxyPool : withProxyPool proxy.$outer = {} for (var i in proxy.$events) { diff --git a/src/js/anot-touch.shim.js b/src/js/anot-touch.shim.js index daa9d88..e91f48c 100644 --- a/src/js/anot-touch.shim.js +++ b/src/js/anot-touch.shim.js @@ -107,14 +107,7 @@ function generateID(mark) { mark = (mark && mark + '-') || 'anot-' - return ( - mark + - Math.random() - .toString(16) - .slice(-4) + - '-' + - ++bindingID - ) + return mark + (++bindingID).toString(16) } var Anot = function(el) { @@ -2123,7 +2116,7 @@ function createTrack(n) { var ret = [] for (var i = 0; i < n; i++) { - ret[i] = generateID('$proxy$each') + ret[i] = generateID('proxy-each') } return ret } @@ -3085,7 +3078,7 @@ return ret } - var rproxy = /(\$proxy\$[a-z]+)\-[\-0-9a-f]+$/ + var rproxy = /(proxy\-[a-z]+)\-[\-0-9a-f]+$/ var variablePool = new Cache(218) //缓存求值函数,以便多次利用 var evaluatorPool = new Cache(128) @@ -3381,7 +3374,7 @@ if (camelizeName.indexOf('@') === 0) { camelizeName = camelizeName.slice(1) attr.value = attr.value.replace(/\(.*\)$/, '') - if (vm.$id.slice(0, 11) === '$proxy$each') { + if (vm.$id.slice(0, 10) === 'proxy-each') { vm = vm.$up } if ( @@ -5965,7 +5958,7 @@ force: force } ) - proxy.$id = generateID('$proxy$each') + proxy.$id = generateID('proxy-each') return proxy } @@ -5998,7 +5991,7 @@ force: force } ) - proxy.$id = generateID('$proxy$with') + proxy.$id = generateID('proxy-with') return proxy } @@ -6006,7 +5999,7 @@ var proxy = cache[key] if (proxy) { var proxyPool = - proxy.$id.indexOf('$proxy$each') === 0 ? eachProxyPool : withProxyPool + proxy.$id.indexOf('proxy-each') === 0 ? eachProxyPool : withProxyPool proxy.$outer = {} for (var i in proxy.$events) { diff --git a/src/js/anot.js b/src/js/anot.js index 5b6cdc1..459b3ca 100644 --- a/src/js/anot.js +++ b/src/js/anot.js @@ -92,14 +92,7 @@ const _Anot = (function() { function generateID(mark) { mark = (mark && mark + '-') || 'anot-' - return ( - mark + - Math.random() - .toString(16) - .slice(-4) + - '-' + - ++bindingID - ) + return mark + (++bindingID).toString(16) } var Anot = function(el) { @@ -2108,7 +2101,7 @@ const _Anot = (function() { function createTrack(n) { var ret = [] for (var i = 0; i < n; i++) { - ret[i] = generateID('$proxy$each') + ret[i] = generateID('proxy-each') } return ret } @@ -3070,7 +3063,7 @@ const _Anot = (function() { return ret } - var rproxy = /(\$proxy\$[a-z]+)\-[\-0-9a-f]+$/ + var rproxy = /(proxy\-[a-z]+)\-[\-0-9a-f]+$/ var variablePool = new Cache(218) //缓存求值函数,以便多次利用 var evaluatorPool = new Cache(128) @@ -3366,7 +3359,7 @@ const _Anot = (function() { if (camelizeName.indexOf('@') === 0) { camelizeName = camelizeName.slice(1) attr.value = attr.value.replace(/\(.*\)$/, '') - if (vm.$id.slice(0, 11) === '$proxy$each') { + if (vm.$id.slice(0, 10) === 'proxy-each') { vm = vm.$up } if ( @@ -5950,7 +5943,7 @@ const _Anot = (function() { force: force } ) - proxy.$id = generateID('$proxy$each') + proxy.$id = generateID('proxy-each') return proxy } @@ -5983,7 +5976,7 @@ const _Anot = (function() { force: force } ) - proxy.$id = generateID('$proxy$with') + proxy.$id = generateID('proxy-with') return proxy } @@ -5991,7 +5984,7 @@ const _Anot = (function() { var proxy = cache[key] if (proxy) { var proxyPool = - proxy.$id.indexOf('$proxy$each') === 0 ? eachProxyPool : withProxyPool + proxy.$id.indexOf('proxy-each') === 0 ? eachProxyPool : withProxyPool proxy.$outer = {} for (var i in proxy.$events) { diff --git a/src/js/anot.shim.js b/src/js/anot.shim.js index ff5187a..1666b1b 100644 --- a/src/js/anot.shim.js +++ b/src/js/anot.shim.js @@ -107,14 +107,7 @@ function generateID(mark) { mark = (mark && mark + '-') || 'anot-' - return ( - mark + - Math.random() - .toString(16) - .slice(-4) + - '-' + - ++bindingID - ) + return mark + (++bindingID).toString(16) } var Anot = function(el) { @@ -2123,7 +2116,7 @@ function createTrack(n) { var ret = [] for (var i = 0; i < n; i++) { - ret[i] = generateID('$proxy$each') + ret[i] = generateID('proxy-each') } return ret } @@ -3085,7 +3078,7 @@ return ret } - var rproxy = /(\$proxy\$[a-z]+)\-[\-0-9a-f]+$/ + var rproxy = /(proxy\-[a-z]+)\-[\-0-9a-f]+$/ var variablePool = new Cache(218) //缓存求值函数,以便多次利用 var evaluatorPool = new Cache(128) @@ -3381,7 +3374,7 @@ if (camelizeName.indexOf('@') === 0) { camelizeName = camelizeName.slice(1) attr.value = attr.value.replace(/\(.*\)$/, '') - if (vm.$id.slice(0, 11) === '$proxy$each') { + if (vm.$id.slice(0, 10) === 'proxy-each') { vm = vm.$up } if ( @@ -5965,7 +5958,7 @@ force: force } ) - proxy.$id = generateID('$proxy$each') + proxy.$id = generateID('proxy-each') return proxy } @@ -5998,7 +5991,7 @@ force: force } ) - proxy.$id = generateID('$proxy$with') + proxy.$id = generateID('proxy-with') return proxy } @@ -6006,7 +5999,7 @@ var proxy = cache[key] if (proxy) { var proxyPool = - proxy.$id.indexOf('$proxy$each') === 0 ? eachProxyPool : withProxyPool + proxy.$id.indexOf('proxy-each') === 0 ? eachProxyPool : withProxyPool proxy.$outer = {} for (var i in proxy.$events) {