OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 var $delete; | 5 var $delete; |
6 var $functionSourceString; | 6 var $functionSourceString; |
7 var $getIterator; | 7 var $getIterator; |
8 var $getMethod; | 8 var $getMethod; |
9 var $globalEval; | 9 var $globalEval; |
10 var $installConstants; | 10 var $installConstants; |
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
798 // Step 9a | 798 // Step 9a |
799 if (IsDataDescriptor(current) != IsDataDescriptor(desc)) { | 799 if (IsDataDescriptor(current) != IsDataDescriptor(desc)) { |
800 if (should_throw) { | 800 if (should_throw) { |
801 throw MakeTypeError(kRedefineDisallowed, p); | 801 throw MakeTypeError(kRedefineDisallowed, p); |
802 } else { | 802 } else { |
803 return false; | 803 return false; |
804 } | 804 } |
805 } | 805 } |
806 // Step 10a | 806 // Step 10a |
807 if (IsDataDescriptor(current) && IsDataDescriptor(desc)) { | 807 if (IsDataDescriptor(current) && IsDataDescriptor(desc)) { |
808 if (!current.isWritable() && desc.isWritable()) { | 808 var currentIsWritable = current.isWritable(); |
809 if (should_throw) { | 809 if (currentIsWritable != desc.isWritable()) { |
810 throw MakeTypeError(kRedefineDisallowed, p); | 810 if (!currentIsWritable) { |
rossberg
2015/05/22 13:10:28
Nit: if (!currentIsWritable || IS_STRONG(obj)) h
conradw
2015/05/22 14:07:08
Done. Silly to miss this.
| |
811 } else { | 811 if (should_throw) { |
812 return false; | 812 throw MakeTypeError(kRedefineDisallowed, p); |
rossberg
2015/05/22 13:10:28
...and then throw currentIsWritable ? MakeTypeErr
conradw
2015/05/22 14:07:08
Done.
| |
813 } else { | |
814 return false; | |
815 } | |
816 } | |
817 if (IS_STRONG(obj)) { | |
rossberg
2015/05/22 13:10:28
...and eliminate this duplication
conradw
2015/05/22 14:07:08
Done.
| |
818 if (should_throw) { | |
819 throw MakeTypeError(kStrongRedefineDisallowed, p, obj); | |
820 } else { | |
821 return false; | |
822 } | |
813 } | 823 } |
814 } | 824 } |
815 if (!current.isWritable() && desc.hasValue() && | 825 if (!currentIsWritable && desc.hasValue() && |
816 !$sameValue(desc.getValue(), current.getValue())) { | 826 !$sameValue(desc.getValue(), current.getValue())) { |
817 if (should_throw) { | 827 if (should_throw) { |
818 throw MakeTypeError(kRedefineDisallowed, p); | 828 throw MakeTypeError(kRedefineDisallowed, p); |
819 } else { | 829 } else { |
820 return false; | 830 return false; |
821 } | 831 } |
822 } | 832 } |
823 } | 833 } |
824 // Step 11 | 834 // Step 11 |
825 if (IsAccessorDescriptor(desc) && IsAccessorDescriptor(current)) { | 835 if (IsAccessorDescriptor(desc) && IsAccessorDescriptor(current)) { |
(...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1970 $objectLookupSetter = ObjectLookupSetter; | 1980 $objectLookupSetter = ObjectLookupSetter; |
1971 $objectToString = ObjectToString; | 1981 $objectToString = ObjectToString; |
1972 $overrideFunction = OverrideFunction; | 1982 $overrideFunction = OverrideFunction; |
1973 $ownPropertyKeys = OwnPropertyKeys; | 1983 $ownPropertyKeys = OwnPropertyKeys; |
1974 $setFunctionName = SetFunctionName; | 1984 $setFunctionName = SetFunctionName; |
1975 $setUpLockedPrototype = SetUpLockedPrototype; | 1985 $setUpLockedPrototype = SetUpLockedPrototype; |
1976 $toCompletePropertyDescriptor = ToCompletePropertyDescriptor; | 1986 $toCompletePropertyDescriptor = ToCompletePropertyDescriptor; |
1977 $toNameArray = ToNameArray; | 1987 $toNameArray = ToNameArray; |
1978 | 1988 |
1979 }) | 1989 }) |
OLD | NEW |