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 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 } | 597 } |
598 | 598 |
599 if (desc.hasConfigurable()) { | 599 if (desc.hasConfigurable()) { |
600 flag |= desc.isConfigurable() ? 0 : DONT_DELETE; | 600 flag |= desc.isConfigurable() ? 0 : DONT_DELETE; |
601 } else if (!IS_UNDEFINED(current)) { | 601 } else if (!IS_UNDEFINED(current)) { |
602 flag |= current.isConfigurable() ? 0 : DONT_DELETE; | 602 flag |= current.isConfigurable() ? 0 : DONT_DELETE; |
603 } else | 603 } else |
604 flag |= DONT_DELETE; | 604 flag |= DONT_DELETE; |
605 | 605 |
606 if (IsDataDescriptor(desc) || IsGenericDescriptor(desc)) { | 606 if (IsDataDescriptor(desc) || IsGenericDescriptor(desc)) { |
607 flag |= desc.isWritable() ? 0 : READ_ONLY; | 607 if (desc.hasWritable()) { |
| 608 flag |= desc.isWritable() ? 0 : READ_ONLY; |
| 609 } else if (!IS_UNDEFINED(current)) { |
| 610 flag |= current.isWritable() ? 0 : READ_ONLY; |
| 611 } else { |
| 612 flag |= READ_ONLY; |
| 613 } |
608 %DefineOrRedefineDataProperty(obj, p, desc.getValue(), flag); | 614 %DefineOrRedefineDataProperty(obj, p, desc.getValue(), flag); |
609 } else { | 615 } else { |
610 if (desc.hasGetter() && IS_FUNCTION(desc.getGet())) { | 616 if (desc.hasGetter() && IS_FUNCTION(desc.getGet())) { |
611 %DefineOrRedefineAccessorProperty(obj, p, GETTER, desc.getGet(), flag); | 617 %DefineOrRedefineAccessorProperty(obj, p, GETTER, desc.getGet(), flag); |
612 } | 618 } |
613 if (desc.hasSetter() && IS_FUNCTION(desc.getSet())) { | 619 if (desc.hasSetter() && IS_FUNCTION(desc.getSet())) { |
614 %DefineOrRedefineAccessorProperty(obj, p, SETTER, desc.getSet(), flag); | 620 %DefineOrRedefineAccessorProperty(obj, p, SETTER, desc.getSet(), flag); |
615 } | 621 } |
616 } | 622 } |
617 return true; | 623 return true; |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1024 | 1030 |
1025 // ---------------------------------------------------------------------------- | 1031 // ---------------------------------------------------------------------------- |
1026 | 1032 |
1027 function SetupFunction() { | 1033 function SetupFunction() { |
1028 InstallFunctions($Function.prototype, DONT_ENUM, $Array( | 1034 InstallFunctions($Function.prototype, DONT_ENUM, $Array( |
1029 "toString", FunctionToString | 1035 "toString", FunctionToString |
1030 )); | 1036 )); |
1031 } | 1037 } |
1032 | 1038 |
1033 SetupFunction(); | 1039 SetupFunction(); |
OLD | NEW |