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 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 // ---------------------------------------------------------------------------- | 202 // ---------------------------------------------------------------------------- |
203 // Object | 203 // Object |
204 | 204 |
205 $Object.prototype.constructor = $Object; | 205 $Object.prototype.constructor = $Object; |
206 | 206 |
207 // ECMA-262 - 15.2.4.2 | 207 // ECMA-262 - 15.2.4.2 |
208 function ObjectToString() { | 208 function ObjectToString() { |
209 if (IS_UNDEFINED(this) && !IS_UNDETECTABLE(this)) { | 209 if (IS_UNDEFINED(this) && !IS_UNDETECTABLE(this)) { |
210 return '[object Undefined]'; | 210 return '[object Undefined]'; |
211 } | 211 } |
212 if (IS_NULL(this)) return '[object Null]'; | 212 if (IS_NULL(this)) return '[object Null]'; |
213 return "[object " + %_ClassOf(ToObject(this)) + "]"; | 213 return "[object " + %_ClassOf(ToObject(this)) + "]"; |
214 } | 214 } |
215 | 215 |
216 | 216 |
217 // ECMA-262 - 15.2.4.3 | 217 // ECMA-262 - 15.2.4.3 |
218 function ObjectToLocaleString() { | 218 function ObjectToLocaleString() { |
219 if (IS_NULL_OR_UNDEFINED(this) && !IS_UNDETECTABLE(this)) { | 219 if (IS_NULL_OR_UNDEFINED(this) && !IS_UNDETECTABLE(this)) { |
220 throw MakeTypeError("called_on_null_or_undefined", | 220 throw MakeTypeError("called_on_null_or_undefined", |
221 ["Object.prototype.toLocaleString"]); | 221 ["Object.prototype.toLocaleString"]); |
222 } | 222 } |
(...skipping 1309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1532 // ---------------------------------------------------------------------------- | 1532 // ---------------------------------------------------------------------------- |
1533 | 1533 |
1534 function SetupFunction() { | 1534 function SetupFunction() { |
1535 InstallFunctions($Function.prototype, DONT_ENUM, $Array( | 1535 InstallFunctions($Function.prototype, DONT_ENUM, $Array( |
1536 "bind", FunctionBind, | 1536 "bind", FunctionBind, |
1537 "toString", FunctionToString | 1537 "toString", FunctionToString |
1538 )); | 1538 )); |
1539 } | 1539 } |
1540 | 1540 |
1541 SetupFunction(); | 1541 SetupFunction(); |
OLD | NEW |