1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Cross-Realm isPlainObject()</title>
<script>
function Foo() {this.abc = {};};
// Should return true with isPlainObject()
var trues = [
Object.create({}),
Object.create(Object.prototype),
{foo: 'bar'},
{}
];
// Should return false with isPlainObject()
var falses = [
/foo/,
function() {},
1,
['foo', 'bar'],
[],
new Foo,
null,
Object.create(null)
];
</script>
</head>
<body></body>
</html>
|