OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This files contains runtime support implemented in JavaScript. | 5 // This files contains runtime support implemented in JavaScript. |
6 | 6 |
7 // CAUTION: Some of the functions specified in this file are called | 7 // CAUTION: Some of the functions specified in this file are called |
8 // directly from compiled code. These are the functions with names in | 8 // directly from compiled code. These are the functions with names in |
9 // ALL CAPS. The compiled code passes the first argument in 'this'. | 9 // ALL CAPS. The compiled code passes the first argument in 'this'. |
10 | 10 |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 if (NUMBER_IS_NAN(left_number) || NUMBER_IS_NAN(right_number)) return ncr; | 203 if (NUMBER_IS_NAN(left_number) || NUMBER_IS_NAN(right_number)) return ncr; |
204 return %NumberCompare(left_number, right_number, ncr); | 204 return %NumberCompare(left_number, right_number, ncr); |
205 } | 205 } |
206 } | 206 } |
207 | 207 |
208 // Strong mode COMPARE throws if an implicit conversion would be performed | 208 // Strong mode COMPARE throws if an implicit conversion would be performed |
209 COMPARE_STRONG = function COMPARE_STRONG(x, ncr) { | 209 COMPARE_STRONG = function COMPARE_STRONG(x, ncr) { |
210 if (IS_STRING(this) && IS_STRING(x)) return %_StringCompare(this, x); | 210 if (IS_STRING(this) && IS_STRING(x)) return %_StringCompare(this, x); |
211 if (IS_NUMBER(this) && IS_NUMBER(x)) return %NumberCompare(this, x, ncr); | 211 if (IS_NUMBER(this) && IS_NUMBER(x)) return %NumberCompare(this, x, ncr); |
212 | 212 |
213 throw %MakeTypeError('strong_implicit_cast'); | 213 throw %MakeTypeError(kStrongImplicitCast); |
214 } | 214 } |
215 | 215 |
216 | 216 |
217 | 217 |
218 /* ----------------------------------- | 218 /* ----------------------------------- |
219 - - - A r i t h m e t i c - - - | 219 - - - A r i t h m e t i c - - - |
220 ----------------------------------- | 220 ----------------------------------- |
221 */ | 221 */ |
222 | 222 |
223 // ECMA-262, section 11.6.1, page 50. | 223 // ECMA-262, section 11.6.1, page 50. |
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1021 $toLength = ToLength; | 1021 $toLength = ToLength; |
1022 $toName = ToName; | 1022 $toName = ToName; |
1023 $toNumber = ToNumber; | 1023 $toNumber = ToNumber; |
1024 $toObject = ToObject; | 1024 $toObject = ToObject; |
1025 $toPositiveInteger = ToPositiveInteger; | 1025 $toPositiveInteger = ToPositiveInteger; |
1026 $toPrimitive = ToPrimitive; | 1026 $toPrimitive = ToPrimitive; |
1027 $toString = ToString; | 1027 $toString = ToString; |
1028 $toUint32 = ToUint32; | 1028 $toUint32 = ToUint32; |
1029 | 1029 |
1030 }) | 1030 }) |
OLD | NEW |