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,26 +0,0 @@
|
|||
"use strict"
|
||||
|
||||
var o = require("../../ospec/ospec")
|
||||
|
||||
// force usage of polyfill
|
||||
var save = Object.assign
|
||||
Object.assign = null
|
||||
delete require.cache[require.resolve("../assign")]
|
||||
var assign = require("../assign")
|
||||
Object.assign = save
|
||||
|
||||
o.spec("assign polyfill", function() {
|
||||
o("works", function() {
|
||||
var target = {hello: "world", foo: "bar"}
|
||||
var source = {foo: "foo", extra: true}
|
||||
|
||||
assign(target, source)
|
||||
|
||||
o(target).deepEquals({hello: "world", foo: "foo", extra: true})
|
||||
|
||||
var falsySources = [null, 0, "", false, void 0]
|
||||
falsySources.forEach(function(falsy) { assign(target, falsy) })
|
||||
|
||||
o(target).deepEquals({hello: "world", foo: "foo", extra: true})
|
||||
})
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue