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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 | 189 |
190 %SetProperty($Boolean.prototype, "constructor", $Boolean, DONT_ENUM); | 190 %SetProperty($Boolean.prototype, "constructor", $Boolean, DONT_ENUM); |
191 | 191 |
192 // ---------------------------------------------------------------------------- | 192 // ---------------------------------------------------------------------------- |
193 // Object | 193 // Object |
194 | 194 |
195 $Object.prototype.constructor = $Object; | 195 $Object.prototype.constructor = $Object; |
196 | 196 |
197 // ECMA-262 - 15.2.4.2 | 197 // ECMA-262 - 15.2.4.2 |
198 function ObjectToString() { | 198 function ObjectToString() { |
199 var c = %_ClassOf(this); | 199 return "[object " + %_ClassOf(this) + "]"; |
200 // Hide Arguments from the outside. | |
201 if (c === 'Arguments') c = 'Object'; | |
202 return "[object " + c + "]"; | |
203 } | 200 } |
204 | 201 |
205 | 202 |
206 // ECMA-262 - 15.2.4.3 | 203 // ECMA-262 - 15.2.4.3 |
207 function ObjectToLocaleString() { | 204 function ObjectToLocaleString() { |
208 return this.toString(); | 205 return this.toString(); |
209 } | 206 } |
210 | 207 |
211 | 208 |
212 // ECMA-262 - 15.2.4.4 | 209 // ECMA-262 - 15.2.4.4 |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 | 570 |
574 // ---------------------------------------------------------------------------- | 571 // ---------------------------------------------------------------------------- |
575 | 572 |
576 function SetupFunction() { | 573 function SetupFunction() { |
577 InstallFunctions($Function.prototype, DONT_ENUM, $Array( | 574 InstallFunctions($Function.prototype, DONT_ENUM, $Array( |
578 "toString", FunctionToString | 575 "toString", FunctionToString |
579 )); | 576 )); |
580 } | 577 } |
581 | 578 |
582 SetupFunction(); | 579 SetupFunction(); |
OLD | NEW |