test empty object
This commit is contained in:
parent
eb25faf8af
commit
5815a590a8
2 changed files with 5 additions and 1 deletions
|
|
@ -139,7 +139,7 @@ m(ComponentUsingThis, {text: "Hello"})
|
||||||
// <div>Hello</div>
|
// <div>Hello</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
Be aware that when using ES5 functions, the value of `this` in nested anonymous functions is not the component instance. There are two recommended ways to get around this Javascript limitation, use ES6 arrow functions, if ES6 is not available, use `vnode.state`.
|
Be aware that when using ES5 functions, the value of `this` in nested anonymous functions is not the component instance. There are two recommended ways to get around this Javascript limitation, use ES6 arrow functions, or if ES6 is not available, use `vnode.state`.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,10 @@ o.spec("parseQueryString", function() {
|
||||||
var data = parseQueryString("?aaa=bbb")
|
var data = parseQueryString("?aaa=bbb")
|
||||||
o(data).deepEquals({aaa: "bbb"})
|
o(data).deepEquals({aaa: "bbb"})
|
||||||
})
|
})
|
||||||
|
o("parses empty string", function() {
|
||||||
|
var data = parseQueryString("")
|
||||||
|
o(data).deepEquals({})
|
||||||
|
})
|
||||||
o("parses flat object", function() {
|
o("parses flat object", function() {
|
||||||
var data = parseQueryString("?a=b&c=d")
|
var data = parseQueryString("?a=b&c=d")
|
||||||
o(data).deepEquals({a: "b", c: "d"})
|
o(data).deepEquals({a: "b", c: "d"})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue