Add m.censor, adjust m.route.Link to use it (#2538)
Also, restructure a few things for better code reuse.
This commit is contained in:
parent
3fa1630f91
commit
34f4363357
15 changed files with 488 additions and 55 deletions
|
|
@ -1,6 +1,7 @@
|
|||
"use strict"
|
||||
|
||||
var buildPathname = require("../pathname/build")
|
||||
var hasOwn = require("../util/hasOwn")
|
||||
|
||||
module.exports = function($window, Promise, oncompletion) {
|
||||
var callbackCount = 0
|
||||
|
|
@ -66,7 +67,7 @@ module.exports = function($window, Promise, oncompletion) {
|
|||
|
||||
function hasHeader(args, name) {
|
||||
for (var key in args.headers) {
|
||||
if ({}.hasOwnProperty.call(args.headers, key) && name.test(key)) return true
|
||||
if (hasOwn.call(args.headers, key) && name.test(key)) return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
|
@ -100,7 +101,7 @@ module.exports = function($window, Promise, oncompletion) {
|
|||
xhr.responseType = responseType
|
||||
|
||||
for (var key in args.headers) {
|
||||
if ({}.hasOwnProperty.call(args.headers, key)) {
|
||||
if (hasOwn.call(args.headers, key)) {
|
||||
xhr.setRequestHeader(key, args.headers[key])
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue