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 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 (!desc.hasWritable() || | 550 (!desc.hasWritable() || |
551 SameValue(desc.isWritable(), current.isWritable())) && | 551 SameValue(desc.isWritable(), current.isWritable())) && |
552 (!desc.hasValue() || | 552 (!desc.hasValue() || |
553 SameValue(desc.getValue(), current.getValue())) && | 553 SameValue(desc.getValue(), current.getValue())) && |
554 (!desc.hasGetter() || | 554 (!desc.hasGetter() || |
555 SameValue(desc.getGet(), current.getGet())) && | 555 SameValue(desc.getGet(), current.getGet())) && |
556 (!desc.hasSetter() || | 556 (!desc.hasSetter() || |
557 SameValue(desc.getSet(), current.getSet()))) { | 557 SameValue(desc.getSet(), current.getSet()))) { |
558 return true; | 558 return true; |
559 } | 559 } |
560 » » » | 560 |
561 // Step 7 | 561 // Step 7 |
562 if (desc.isConfigurable() || desc.isEnumerable() != current.isEnumerable()) | 562 if (desc.isConfigurable() || desc.isEnumerable() != current.isEnumerable()) |
563 throw MakeTypeError("redefine_disallowed", ["defineProperty"]); | 563 throw MakeTypeError("redefine_disallowed", ["defineProperty"]); |
564 // Step 9 | 564 // Step 9 |
565 if (IsDataDescriptor(current) != IsDataDescriptor(desc)) | 565 if (IsDataDescriptor(current) != IsDataDescriptor(desc)) |
566 throw MakeTypeError("redefine_disallowed", ["defineProperty"]); | 566 throw MakeTypeError("redefine_disallowed", ["defineProperty"]); |
567 // Step 10 | 567 // Step 10 |
568 if (IsDataDescriptor(current) && IsDataDescriptor(desc)) { | 568 if (IsDataDescriptor(current) && IsDataDescriptor(desc)) { |
569 if (!current.isWritable() && desc.isWritable()) | 569 if (!current.isWritable() && desc.isWritable()) |
570 throw MakeTypeError("redefine_disallowed", ["defineProperty"]); | 570 throw MakeTypeError("redefine_disallowed", ["defineProperty"]); |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1024 | 1024 |
1025 // ---------------------------------------------------------------------------- | 1025 // ---------------------------------------------------------------------------- |
1026 | 1026 |
1027 function SetupFunction() { | 1027 function SetupFunction() { |
1028 InstallFunctions($Function.prototype, DONT_ENUM, $Array( | 1028 InstallFunctions($Function.prototype, DONT_ENUM, $Array( |
1029 "toString", FunctionToString | 1029 "toString", FunctionToString |
1030 )); | 1030 )); |
1031 } | 1031 } |
1032 | 1032 |
1033 SetupFunction(); | 1033 SetupFunction(); |
OLD | NEW |