|
@@ -143,7 +143,7 @@ function Person(name, surname){
|
|
|
}
|
|
|
|
|
|
this.getFullName = function (){
|
|
|
- if ("fatherName" in person){
|
|
|
+ if ("fatherName" in this){
|
|
|
return getFullLongName()
|
|
|
}
|
|
|
else {
|
|
@@ -176,7 +176,7 @@ alert(person.getFullName()) //this == person
|
|
|
|
|
|
this.getFullName = function (){
|
|
|
|
|
|
- if ("fatherName" in person){
|
|
|
+ if ("fatherName" in this){
|
|
|
return getFullLongName(); //this == window или undefined в strict
|
|
|
}
|
|
|
else {
|
|
@@ -203,7 +203,7 @@ function Person(name, surname){
|
|
|
}
|
|
|
|
|
|
this.getFullName = function (){
|
|
|
- if ("fatherName" in person){
|
|
|
+ if ("fatherName" in this){
|
|
|
return getFullLongName.call(this) //передаем текущий объект person как this в getFullLongName
|
|
|
}
|
|
|
else {
|
|
@@ -237,7 +237,7 @@ function Person(name, surname){
|
|
|
}
|
|
|
|
|
|
this.getFullName = function (){
|
|
|
- if ("fatherName" in person){
|
|
|
+ if ("fatherName" in this){
|
|
|
return getFullLongName()
|
|
|
}
|
|
|
else {
|