| 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 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 var value = props[key]; | 682 var value = props[key]; |
| 683 var desc = ToPropertyDescriptor(value); | 683 var desc = ToPropertyDescriptor(value); |
| 684 key_values.push(desc); | 684 key_values.push(desc); |
| 685 } | 685 } |
| 686 } | 686 } |
| 687 for (var i = 0; i < key_values.length; i += 2) { | 687 for (var i = 0; i < key_values.length; i += 2) { |
| 688 var key = key_values[i]; | 688 var key = key_values[i]; |
| 689 var desc = key_values[i + 1]; | 689 var desc = key_values[i + 1]; |
| 690 DefineOwnProperty(obj, key, desc, true); | 690 DefineOwnProperty(obj, key, desc, true); |
| 691 } | 691 } |
| 692 return obj; |
| 692 } | 693 } |
| 693 | 694 |
| 694 | 695 |
| 695 %SetCode($Object, function(x) { | 696 %SetCode($Object, function(x) { |
| 696 if (%_IsConstructCall()) { | 697 if (%_IsConstructCall()) { |
| 697 if (x == null) return this; | 698 if (x == null) return this; |
| 698 return ToObject(x); | 699 return ToObject(x); |
| 699 } else { | 700 } else { |
| 700 if (x == null) return { }; | 701 if (x == null) return { }; |
| 701 return ToObject(x); | 702 return ToObject(x); |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 988 | 989 |
| 989 // ---------------------------------------------------------------------------- | 990 // ---------------------------------------------------------------------------- |
| 990 | 991 |
| 991 function SetupFunction() { | 992 function SetupFunction() { |
| 992 InstallFunctions($Function.prototype, DONT_ENUM, $Array( | 993 InstallFunctions($Function.prototype, DONT_ENUM, $Array( |
| 993 "toString", FunctionToString | 994 "toString", FunctionToString |
| 994 )); | 995 )); |
| 995 } | 996 } |
| 996 | 997 |
| 997 SetupFunction(); | 998 SetupFunction(); |
| OLD | NEW |