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 #include "src/builtins.h" | 5 #include "src/builtins.h" |
6 | 6 |
7 #include "src/api-arguments.h" | 7 #include "src/api-arguments.h" |
8 #include "src/api-natives.h" | 8 #include "src/api-natives.h" |
9 #include "src/api.h" | 9 #include "src/api.h" |
10 #include "src/base/ieee754.h" | 10 #include "src/base/ieee754.h" |
(...skipping 1690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1701 desc.set_configurable(true); | 1701 desc.set_configurable(true); |
1702 // 4. Let key be ? ToPropertyKey(P). | 1702 // 4. Let key be ? ToPropertyKey(P). |
1703 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, name, | 1703 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, name, |
1704 Object::ToPropertyKey(isolate, name)); | 1704 Object::ToPropertyKey(isolate, name)); |
1705 // 5. Perform ? DefinePropertyOrThrow(O, key, desc). | 1705 // 5. Perform ? DefinePropertyOrThrow(O, key, desc). |
1706 // To preserve legacy behavior, we ignore errors silently rather than | 1706 // To preserve legacy behavior, we ignore errors silently rather than |
1707 // throwing an exception. | 1707 // throwing an exception. |
1708 Maybe<bool> success = JSReceiver::DefineOwnProperty( | 1708 Maybe<bool> success = JSReceiver::DefineOwnProperty( |
1709 isolate, receiver, name, &desc, Object::DONT_THROW); | 1709 isolate, receiver, name, &desc, Object::DONT_THROW); |
1710 MAYBE_RETURN(success, isolate->heap()->exception()); | 1710 MAYBE_RETURN(success, isolate->heap()->exception()); |
| 1711 if (!success.FromJust()) { |
| 1712 isolate->CountUsage(v8::Isolate::kDefineGetterOrSetterWouldThrow); |
| 1713 } |
1711 // 6. Return undefined. | 1714 // 6. Return undefined. |
1712 return isolate->heap()->undefined_value(); | 1715 return isolate->heap()->undefined_value(); |
1713 } | 1716 } |
1714 | 1717 |
1715 Object* ObjectLookupAccessor(Isolate* isolate, Handle<Object> object, | 1718 Object* ObjectLookupAccessor(Isolate* isolate, Handle<Object> object, |
1716 Handle<Object> key, AccessorComponent component) { | 1719 Handle<Object> key, AccessorComponent component) { |
1717 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, object, | 1720 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, object, |
1718 Object::ConvertReceiver(isolate, object)); | 1721 Object::ConvertReceiver(isolate, object)); |
1719 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, key, | 1722 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, key, |
1720 Object::ToPropertyKey(isolate, key)); | 1723 Object::ToPropertyKey(isolate, key)); |
(...skipping 4344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6065 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 6068 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
6066 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 6069 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
6067 #undef DEFINE_BUILTIN_ACCESSOR_C | 6070 #undef DEFINE_BUILTIN_ACCESSOR_C |
6068 #undef DEFINE_BUILTIN_ACCESSOR_A | 6071 #undef DEFINE_BUILTIN_ACCESSOR_A |
6069 #undef DEFINE_BUILTIN_ACCESSOR_T | 6072 #undef DEFINE_BUILTIN_ACCESSOR_T |
6070 #undef DEFINE_BUILTIN_ACCESSOR_S | 6073 #undef DEFINE_BUILTIN_ACCESSOR_S |
6071 #undef DEFINE_BUILTIN_ACCESSOR_H | 6074 #undef DEFINE_BUILTIN_ACCESSOR_H |
6072 | 6075 |
6073 } // namespace internal | 6076 } // namespace internal |
6074 } // namespace v8 | 6077 } // namespace v8 |
OLD | NEW |