| 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 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 %SetCode($Object, function(x) { | 829 %SetCode($Object, function(x) { |
| 830 if (%_IsConstructCall()) { | 830 if (%_IsConstructCall()) { |
| 831 if (x == null) return this; | 831 if (x == null) return this; |
| 832 return ToObject(x); | 832 return ToObject(x); |
| 833 } else { | 833 } else { |
| 834 if (x == null) return { }; | 834 if (x == null) return { }; |
| 835 return ToObject(x); | 835 return ToObject(x); |
| 836 } | 836 } |
| 837 }); | 837 }); |
| 838 | 838 |
| 839 %SetExpectedNumberOfProperties($Object, 4); |
| 839 | 840 |
| 840 // ---------------------------------------------------------------------------- | 841 // ---------------------------------------------------------------------------- |
| 841 | 842 |
| 842 | 843 |
| 843 function SetupObject() { | 844 function SetupObject() { |
| 844 // Setup non-enumerable functions on the Object.prototype object. | 845 // Setup non-enumerable functions on the Object.prototype object. |
| 845 InstallFunctions($Object.prototype, DONT_ENUM, $Array( | 846 InstallFunctions($Object.prototype, DONT_ENUM, $Array( |
| 846 "toString", ObjectToString, | 847 "toString", ObjectToString, |
| 847 "toLocaleString", ObjectToLocaleString, | 848 "toLocaleString", ObjectToLocaleString, |
| 848 "valueOf", ObjectValueOf, | 849 "valueOf", ObjectValueOf, |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1179 // ---------------------------------------------------------------------------- | 1180 // ---------------------------------------------------------------------------- |
| 1180 | 1181 |
| 1181 function SetupFunction() { | 1182 function SetupFunction() { |
| 1182 InstallFunctions($Function.prototype, DONT_ENUM, $Array( | 1183 InstallFunctions($Function.prototype, DONT_ENUM, $Array( |
| 1183 "bind", FunctionBind, | 1184 "bind", FunctionBind, |
| 1184 "toString", FunctionToString | 1185 "toString", FunctionToString |
| 1185 )); | 1186 )); |
| 1186 } | 1187 } |
| 1187 | 1188 |
| 1188 SetupFunction(); | 1189 SetupFunction(); |
| OLD | NEW |