Преглед изворни кода

Nextrefactor: `.test` is faster than `.match` for regex bools (#3074)

* refactor: `.test` is faster than `.match` for regex bools

* chore: whoops.. wasnt suppose to commit these files

* fix: mixxup from the iOS version match
Marais Rossouw пре 10 година
родитељ
комит
94c7527d3c
2 измењених фајлова са 2 додато и 2 уклоњено
  1. 1 1
      src/core/util/env.js
  2. 1 1
      src/platforms/web/runtime/directives/model.js

+ 1 - 1
src/core/util/env.js

@@ -83,7 +83,7 @@ export const nextTick = (function () {
 
 let _Set
 /* istanbul ignore if */
-if (typeof Set !== 'undefined' && Set.toString().match(/native code/)) {
+if (typeof Set !== 'undefined' && /native code/.test(Set.toString())) {
   // use native Set when available.
   _Set = Set
 } else {

+ 1 - 1
src/platforms/web/runtime/directives/model.js

@@ -20,7 +20,7 @@ if (isIE9) {
 export default {
   bind (el, binding, vnode) {
     if (process.env.NODE_ENV !== 'production') {
-      if (!vnode.tag.match(/input|select|textarea/)) {
+      if (!/input|select|textarea/.test(vnode.tag)) {
         warn(
           `v-model is not supported on element type: <${vnode.tag}>. ` +
           'If you are working with contenteditable, it\'s recommended to ' +