29. 11.9.1 The Equals Operator (== )
The production EqualityExpression : EqualityExpression ==
RelationalExpression is evaluated as follows:
1. EqualityExpression
2. GetValue(Result(1))
3. RelationalExpression
4. GetValue(Result(3))
5. Result(4) == Result(2) ( 11.9.3)
6. Result(5).
30. 11.9.3 The Abstract Equality Comparison Algorithm
The comparison x == y, where x and y are values, produces true or
false. Such a comparison is performed as follows:
1. Type(x) Type(y) 14
2. Type(x) Undefined, true
3. Type(x) Null, true
4. Type(x) Number, 11
5. x NaN, false
6. y NaN, false
7. x y , true
Type(x)
8. x +0 y -0, true Number
9. x is -0 y +0, true
10. false
31. 11. Type(x) String,
true false
12. Type(x) Boolean, x y true
false true false Type(x)
13. x y
Number
( 13.1.2) false
32. 14. x null y undefined, true.
15. x undefined y null, true.
16. Type(x) Number Type(y) String, x ==
ToNumber(y)
17. Type(x) String Type(y) Number, ToNumber
(x)== y
18. Type(x) Boolean, ToNumber(x)== y
19. Type(y) Boolean, x == ToNumber(y)
20. Type(x) String Number Type(y) Object,
x == ToPrimitive(y)
21. Type(x) Object Type(y) String Number,
ToPrimitive(x)== y
22. Return false.
36. 11.2.2 The new Operator
The production NewExpression : new NewExpression is evaluated as
follows:
1. NewExpression
2. GetValue(Result(1))
3. Type(Result(2)) Object, TypeError
4. Result(2) [[Construct]], TypeError
5. Result(2) [[Construct]]
6. Result(5)
37. 13.2.2 [[Construct]]
When the [[Construct]] property for a Function object F is called,
the following steps are taken:
1.
2. Result(1) [[Class]] "Object"
3. F prototype
4. Result(3) object , Result(1) [[Prototype]]
Result(3)
5. Result(3) object , Result(1) [[Prototype]]
Object prototype ( 15.2.3.1)
6. F [[Call]] Result(1) this
[[Construct]]
7. Type(Result(6)) Object Result(6)
8. Result(1)