Skip to content

Commit c97e442

Browse files
committed
prototype chain complete
1 parent d1b069c commit c97e442

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-
equal(__, child.hasOwnProperty('a'), 'child.hasOwnProperty(\'a\')?');
31-
equal(__, child.hasOwnProperty('b'), 'child.hasOwnProperty(\'b\')?');
30+
equal(true, child.hasOwnProperty('a'), 'child.hasOwnProperty(\'a\')?');
31+
equal(true, child.hasOwnProperty('b'), 'child.hasOwnProperty(\'b\')?');
3232
});
3333

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

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

4444

4545
test("Is there a 'c' own property on child?", function () {
46-
equal(__, child.hasOwnProperty('c'), 'child.hasOwnProperty(\'c\')?');
46+
equal(false, child.hasOwnProperty('c'), '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-
equal(__, child.c, 'what is the value of child.c?');
52+
equal(4, child.c, '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-
equal(__, child.d, 'what is the value of child.d?');
60+
equal(null, child.d, 'what is the value of child.d?');
6161
});
6262

6363

0 commit comments

Comments
 (0)