Skip to content

Commit 94c7527

Browse files
maraisryyx990803
authored andcommitted
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
1 parent d1a5298 commit 94c7527

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/core/util/env.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export const nextTick = (function () {
8383

8484
let _Set
8585
/* istanbul ignore if */
86-
if (typeof Set !== 'undefined' && Set.toString().match(/native code/)) {
86+
if (typeof Set !== 'undefined' && /native code/.test(Set.toString())) {
8787
// use native Set when available.
8888
_Set = Set
8989
} else {

src/platforms/web/runtime/directives/model.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ if (isIE9) {
2020
export default {
2121
bind (el, binding, vnode) {
2222
if (process.env.NODE_ENV !== 'production') {
23-
if (!vnode.tag.match(/input|select|textarea/)) {
23+
if (!/input|select|textarea/.test(vnode.tag)) {
2424
warn(
2525
`v-model is not supported on element type: <${vnode.tag}>. ` +
2626
'If you are working with contenteditable, it\'s recommended to ' +

0 commit comments

Comments
 (0)