Use RegExp#test instead of String#match
Using `.test()` is both faster and more explicit.
This commit is contained in:
parent
dca271faef
commit
7a184cb3b7
1 changed files with 2 additions and 2 deletions
|
|
@ -456,7 +456,7 @@
|
|||
nodes = injectHTML(parentElement, index, data)
|
||||
} else {
|
||||
nodes = [$document.createTextNode(data)]
|
||||
if (!parentElement.nodeName.match(voidElements)) {
|
||||
if (!voidElements.test(parentElement.nodeName)) {
|
||||
insertNode(parentElement, nodes[0], index)
|
||||
}
|
||||
}
|
||||
|
|
@ -1902,7 +1902,7 @@
|
|||
|
||||
m.deferred.onerror = function (e) {
|
||||
if (type.call(e) === "[object Error]" &&
|
||||
!e.constructor.toString().match(/ Error/)) {
|
||||
!/ Error/.test(e.constructor.toString())) {
|
||||
pendingRequests = 0
|
||||
throw e
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue