OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/api-natives.h" | 5 #include "src/api-natives.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/isolate-inl.h" | 8 #include "src/isolate-inl.h" |
9 #include "src/lookup.h" | 9 #include "src/lookup.h" |
10 #include "src/messages.h" | 10 #include "src/messages.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 } | 36 } |
37 } | 37 } |
38 | 38 |
39 | 39 |
40 MaybeHandle<Object> DefineAccessorProperty(Isolate* isolate, | 40 MaybeHandle<Object> DefineAccessorProperty(Isolate* isolate, |
41 Handle<JSObject> object, | 41 Handle<JSObject> object, |
42 Handle<Name> name, | 42 Handle<Name> name, |
43 Handle<Object> getter, | 43 Handle<Object> getter, |
44 Handle<Object> setter, | 44 Handle<Object> setter, |
45 PropertyAttributes attributes) { | 45 PropertyAttributes attributes) { |
46 if (!getter->IsUndefined()) { | |
47 ASSIGN_RETURN_ON_EXCEPTION( | |
48 isolate, getter, | |
49 InstantiateFunction(isolate, | |
50 Handle<FunctionTemplateInfo>::cast(getter)), | |
51 Object); | |
52 } | |
53 if (!setter->IsUndefined()) { | |
54 ASSIGN_RETURN_ON_EXCEPTION( | |
55 isolate, setter, | |
56 InstantiateFunction(isolate, | |
57 Handle<FunctionTemplateInfo>::cast(setter)), | |
58 Object); | |
59 } | |
60 RETURN_ON_EXCEPTION(isolate, JSObject::DefineAccessor(object, name, getter, | 46 RETURN_ON_EXCEPTION(isolate, JSObject::DefineAccessor(object, name, getter, |
61 setter, attributes), | 47 setter, attributes), |
62 Object); | 48 Object); |
63 return object; | 49 return object; |
64 } | 50 } |
65 | 51 |
66 | 52 |
67 MaybeHandle<Object> DefineDataProperty(Isolate* isolate, | 53 MaybeHandle<Object> DefineDataProperty(Isolate* isolate, |
68 Handle<JSObject> object, | 54 Handle<JSObject> object, |
69 Handle<Name> name, | 55 Handle<Name> name, |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 Handle<AccessorInfo> accessor(AccessorInfo::cast(array->get(i))); | 602 Handle<AccessorInfo> accessor(AccessorInfo::cast(array->get(i))); |
617 JSObject::SetAccessor(result, accessor).Assert(); | 603 JSObject::SetAccessor(result, accessor).Assert(); |
618 } | 604 } |
619 | 605 |
620 DCHECK(result->shared()->IsApiFunction()); | 606 DCHECK(result->shared()->IsApiFunction()); |
621 return result; | 607 return result; |
622 } | 608 } |
623 | 609 |
624 } // namespace internal | 610 } // namespace internal |
625 } // namespace v8 | 611 } // namespace v8 |
OLD | NEW |