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 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 // ES5 section 15.2.3.12 | 777 // ES5 section 15.2.3.12 |
778 function ObjectIsFrozen(obj) { | 778 function ObjectIsFrozen(obj) { |
779 if ((!IS_SPEC_OBJECT_OR_NULL(obj) || IS_NULL_OR_UNDEFINED(obj)) && | 779 if ((!IS_SPEC_OBJECT_OR_NULL(obj) || IS_NULL_OR_UNDEFINED(obj)) && |
780 !IS_UNDETECTABLE(obj)) { | 780 !IS_UNDETECTABLE(obj)) { |
781 throw MakeTypeError("obj_ctor_property_non_object", ["isFrozen"]); | 781 throw MakeTypeError("obj_ctor_property_non_object", ["isFrozen"]); |
782 } | 782 } |
783 var names = ObjectGetOwnPropertyNames(obj); | 783 var names = ObjectGetOwnPropertyNames(obj); |
784 for (var key in names) { | 784 for (var key in names) { |
785 var name = names[key]; | 785 var name = names[key]; |
786 var desc = GetOwnProperty(obj, name); | 786 var desc = GetOwnProperty(obj, name); |
787 if (IsDataDescriptor(desc) && desc.writable) return false; | 787 if (IsDataDescriptor(desc) && desc.isWritable()) return false; |
788 if (desc.configurable) return false; | 788 if (desc.isConfigurable()) return false; |
789 } | 789 } |
790 if (!ObjectIsExtensible(obj)) { | 790 if (!ObjectIsExtensible(obj)) { |
791 return true; | 791 return true; |
792 } | 792 } |
793 return false; | 793 return false; |
794 } | 794 } |
795 | 795 |
796 | 796 |
797 // ES5 section 15.2.3.13 | 797 // ES5 section 15.2.3.13 |
798 function ObjectIsExtensible(obj) { | 798 function ObjectIsExtensible(obj) { |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1104 | 1104 |
1105 // ---------------------------------------------------------------------------- | 1105 // ---------------------------------------------------------------------------- |
1106 | 1106 |
1107 function SetupFunction() { | 1107 function SetupFunction() { |
1108 InstallFunctions($Function.prototype, DONT_ENUM, $Array( | 1108 InstallFunctions($Function.prototype, DONT_ENUM, $Array( |
1109 "toString", FunctionToString | 1109 "toString", FunctionToString |
1110 )); | 1110 )); |
1111 } | 1111 } |
1112 | 1112 |
1113 SetupFunction(); | 1113 SetupFunction(); |
OLD | NEW |