mirror of
https://github.com/flynx/Course-JavaScript.git
synced 2025-12-18 17:41:43 +00:00
more minor fixes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
8d0817e864
commit
ad14667008
16
js-oop.js
16
js-oop.js
@ -4,6 +4,10 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*********************************************************************/
|
||||||
//
|
//
|
||||||
// The basic prototype inheritance
|
// The basic prototype inheritance
|
||||||
// -------------------------------
|
// -------------------------------
|
||||||
@ -66,8 +70,8 @@
|
|||||||
|
|
||||||
// Another way to test if the attribute is own/local
|
// Another way to test if the attribute is own/local
|
||||||
|
|
||||||
b.isOwnProperty('z') // -> true
|
b.hasOwnProperty('z') // -> true
|
||||||
b.isOwnProperty('x') // -> false
|
b.hasOwnProperty('x') // -> false
|
||||||
|
|
||||||
|
|
||||||
// What happens under the hood is very simple:
|
// What happens under the hood is very simple:
|
||||||
@ -483,15 +487,15 @@
|
|||||||
// In quirks mode a function call is always done in the root
|
// In quirks mode a function call is always done in the root
|
||||||
// context, it's like implicitly calling a method of the global
|
// context, it's like implicitly calling a method of the global
|
||||||
// object:
|
// object:
|
||||||
f() === window.f()
|
// f() === window.f()
|
||||||
// -> true
|
// // -> true
|
||||||
// In strict mode these are two different things, a function call
|
// In strict mode these are two different things, a function call
|
||||||
// is done without a context ('this' is undefined) while calling
|
// is done without a context ('this' is undefined) while calling
|
||||||
// the same function via the global object is essentially a method
|
// the same function via the global object is essentially a method
|
||||||
// call, setting 'this' to what is to the left of the attribute
|
// call, setting 'this' to what is to the left of the attribute
|
||||||
// access operator:
|
// access operator:
|
||||||
strict_f() !== window.strict_f()
|
// strict_f() !== window.strict_f()
|
||||||
// -> true
|
// // -> true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user