Skip to content

Commit a9e0180

Browse files
committed
about_prototype_chain
1 parent b901ad9 commit a9e0180

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

topics/about_prototype_chain.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,37 +27,37 @@ child.b = 2;
2727
* */
2828

2929
test("Is there an 'a' and 'b' own property on child?", function () {
30-
equals(child.hasOwnProperty('a'), __, 'child.hasOwnProperty(\'a\')?');
31-
equals(child.hasOwnProperty('b'), __, 'child.hasOwnProperty(\'b\')?');
30+
equals(child.hasOwnProperty('a'), true, 'child.hasOwnProperty(\'a\')?');
31+
equals(child.hasOwnProperty('b'), true, 'child.hasOwnProperty(\'b\')?');
3232
});
3333

3434
test("Is there an 'a' and 'b' property on child?", function () {
35-
equals(child.a, __, 'what is \'a\' value?');
36-
equals(child.b, __, 'what is \'b\' value?');
35+
equals(child.a, 1, 'what is \'a\' value?');
36+
equals(child.b, 2, 'what is \'b\' value?');
3737
});
3838

3939
test("If 'b' was removed, whats b value?", function () {
4040
delete child.b;
41-
equals(child.b, __, 'what is \'b\' value now?');
41+
equals(child.b, 3, 'what is \'b\' value now?');
4242
});
4343

4444

4545
test("Is there a 'c' own property on child?", function () {
46-
equals(child.hasOwnProperty('c'), __, 'child.hasOwnProperty(\'c\')?');
46+
equals(child.hasOwnProperty('c'), false, 'child.hasOwnProperty(\'c\')?');
4747
});
4848

4949
// Is there a 'c' own property on child? No, check its prototype
5050
// Is there a 'c' own property on child.[[Prototype]]? Yes, its value is...
5151
test("Is there a 'c' property on child?", function () {
52-
equals(child.c, __, 'what is the value of child.c?');
52+
equals(child.c, 4, 'what is the value of child.c?');
5353
});
5454

5555

5656
// Is there a 'd' own property on child? No, check its prototype
5757
// Is there a 'd' own property on child.[[Prototype]]? No, check it prototype
5858
// child.[[Prototype]].[[Prototype]] is null, stop searching, no property found, return...
5959
test("Is there an 'd' property on child?", function () {
60-
equals(child.d, __, 'what is the value of child.d?');
60+
equals(child.d, undefined, 'what is the value of child.d?');
6161
});
6262

6363

0 commit comments

Comments
 (0)